commit c49cf936bad6477dade2f7291fbd159990418116 Author: Philipp Kunz Date: Mon Jan 29 13:55:55 2024 +0100 fix(core): update diff --git a/.gitea/workflows/default_nottags.yaml b/.gitea/workflows/default_nottags.yaml new file mode 100644 index 0000000..9f4e743 --- /dev/null +++ b/.gitea/workflows/default_nottags.yaml @@ -0,0 +1,66 @@ +name: Default (not tags) + +on: + push: + tags-ignore: + - '**' + +env: + IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci + NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git + NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}} + NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}} + NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}} + NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}} + +jobs: + security: + runs-on: ubuntu-latest + continue-on-error: true + container: + image: ${{ env.IMAGE }} + + steps: + - uses: actions/checkout@v3 + + - name: Install pnpm and npmci + run: | + pnpm install -g pnpm + pnpm install -g @shipzone/npmci + + - name: Run npm prepare + run: npmci npm prepare + + - name: Audit production dependencies + run: | + npmci command npm config set registry https://registry.npmjs.org + npmci command pnpm audit --audit-level=high --prod + continue-on-error: true + + - name: Audit development dependencies + run: | + npmci command npm config set registry https://registry.npmjs.org + npmci command pnpm audit --audit-level=high --dev + continue-on-error: true + + test: + if: ${{ always() }} + needs: security + runs-on: ubuntu-latest + container: + image: ${{ env.IMAGE }} + + steps: + - uses: actions/checkout@v3 + + - name: Test stable + run: | + npmci node install stable + npmci npm install + npmci npm test + + - name: Test build + run: | + npmci node install stable + npmci npm install + npmci npm build diff --git a/.gitea/workflows/default_tags.yaml b/.gitea/workflows/default_tags.yaml new file mode 100644 index 0000000..e27ad69 --- /dev/null +++ b/.gitea/workflows/default_tags.yaml @@ -0,0 +1,124 @@ +name: Default (tags) + +on: + push: + tags: + - '*' + +env: + IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci + NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git + NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}} + NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}} + NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}} + NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}} + +jobs: + security: + runs-on: ubuntu-latest + continue-on-error: true + container: + image: ${{ env.IMAGE }} + + steps: + - uses: actions/checkout@v3 + + - name: Prepare + run: | + pnpm install -g pnpm + pnpm install -g @shipzone/npmci + npmci npm prepare + + - name: Audit production dependencies + run: | + npmci command npm config set registry https://registry.npmjs.org + npmci command pnpm audit --audit-level=high --prod + continue-on-error: true + + - name: Audit development dependencies + run: | + npmci command npm config set registry https://registry.npmjs.org + npmci command pnpm audit --audit-level=high --dev + continue-on-error: true + + test: + if: ${{ always() }} + needs: security + runs-on: ubuntu-latest + container: + image: ${{ env.IMAGE }} + + steps: + - uses: actions/checkout@v3 + + - name: Prepare + run: | + pnpm install -g pnpm + pnpm install -g @shipzone/npmci + npmci npm prepare + + - name: Test stable + run: | + npmci node install stable + npmci npm install + npmci npm test + + - name: Test build + run: | + npmci node install stable + npmci npm install + npmci npm build + + release: + needs: test + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + container: + image: ${{ env.IMAGE }} + + steps: + - uses: actions/checkout@v3 + + - name: Prepare + run: | + pnpm install -g pnpm + pnpm install -g @shipzone/npmci + npmci npm prepare + + - name: Release + run: | + npmci node install stable + npmci npm publish + + metadata: + needs: test + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + container: + image: ${{ env.IMAGE }} + continue-on-error: true + + steps: + - uses: actions/checkout@v3 + + - name: Prepare + run: | + pnpm install -g pnpm + pnpm install -g @shipzone/npmci + npmci npm prepare + + - name: Code quality + run: | + npmci command npm install -g typescript + npmci npm install + + - name: Trigger + run: npmci trigger + + - name: Build docs and upload artifacts + run: | + npmci node install stable + npmci npm install + pnpm install -g @git.zone/tsdoc + npmci command tsdoc + continue-on-error: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ef13c79 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +.nogit/ + +# artifacts +coverage/ +public/ +pages/ + +# installs +node_modules/ + +# caches +.yarn/ +.cache/ +.rpt2_cache + +# builds +dist/ +dist_*/ + +# custom \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..26e9f92 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "command": "npm test", + "name": "Run npm test", + "request": "launch", + "type": "node-terminal" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3648eaa --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,26 @@ +{ + "json.schemas": [ + { + "fileMatch": ["/npmextra.json"], + "schema": { + "type": "object", + "properties": { + "npmci": { + "type": "object", + "description": "settings for npmci" + }, + "gitzone": { + "type": "object", + "description": "settings for gitzone", + "properties": { + "projectType": { + "type": "string", + "enum": ["website", "element", "service", "npm", "wcc"] + } + } + } + } + } + } + ] +} diff --git a/npmextra.json b/npmextra.json new file mode 100644 index 0000000..ac9d3d1 --- /dev/null +++ b/npmextra.json @@ -0,0 +1,18 @@ +{ + "gitzone": { + "projectType": "npm", + "module": { + "githost": "gitlab.com", + "gitscope": "apiclient.xyz", + "gitrepo": "hetznercloud", + "description": "an unofficial api client for the hetzner cloud api", + "npmPackagename": "@apiclient.xyz/hetznercloud", + "license": "MIT", + "projectDomain": "apiclient.xyz" + } + }, + "npmci": { + "npmGlobalTools": [], + "npmAccessLevel": "public" + } +} \ No newline at end of file diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..e73b975 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.2.0" + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..1e1451c --- /dev/null +++ b/package.json @@ -0,0 +1,49 @@ +{ + "name": "@apiclient.xyz/hetznercloud", + "version": "1.0.1", + "private": false, + "description": "an unofficial api client for the hetzner cloud api", + "main": "dist_ts/index.js", + "typings": "dist_ts/index.d.ts", + "type": "module", + "author": "Task Venture Capital GmbH", + "license": "MIT", + "scripts": { + "test": "(tstest test/ --web)", + "build": "(tsbuild --web --allowimplicitany)", + "buildDocs": "(tsdoc)", + "create": "openapi-generator-cli generate -i https://docs.hetzner.cloud/spec.json -g typescript-node -o ts_openapi" + }, + "devDependencies": { + "@git.zone/tsbuild": "^2.1.25", + "@git.zone/tsbundle": "^2.0.5", + "@git.zone/tsrun": "^1.2.46", + "@git.zone/tstest": "^1.0.44", + "@push.rocks/tapbundle": "^5.0.15", + "@types/node": "^20.8.7" + }, + "dependencies": {}, + "repository": { + "type": "git", + "url": "git+https://gitlab.com/apiclient.xyz/hetznercloud.git" + }, + "bugs": { + "url": "https://gitlab.com/apiclient.xyz/hetznercloud/issues" + }, + "homepage": "https://gitlab.com/apiclient.xyz/hetznercloud#readme", + "browserslist": [ + "last 1 chrome versions" + ], + "files": [ + "ts/**/*", + "ts_web/**/*", + "dist/**/*", + "dist_*/**/*", + "dist_ts/**/*", + "dist_ts_web/**/*", + "assets/**/*", + "cli.js", + "npmextra.json", + "readme.md" + ] +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..32a8cd1 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,5651 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +devDependencies: + '@git.zone/tsbuild': + specifier: ^2.1.25 + version: 2.1.72 + '@git.zone/tsbundle': + specifier: ^2.0.5 + version: 2.0.15 + '@git.zone/tsrun': + specifier: ^1.2.46 + version: 1.2.46(@types/node@20.11.10) + '@git.zone/tstest': + specifier: ^1.0.44 + version: 1.0.86(@types/node@20.11.10)(sinon@17.0.1) + '@push.rocks/tapbundle': + specifier: ^5.0.15 + version: 5.0.15(sinon@17.0.1) + '@types/node': + specifier: ^20.8.7 + version: 20.11.10 + +packages: + + /@api.global/typedrequest-interfaces@3.0.1: + resolution: {integrity: sha512-eR2Cr01BYRwIq/X2ajOenWhm8l+/YE4A5kK/9V6I8ZnhtEBMFHG6YjF6Fg8npLJWbvhZXhOms+axZ6JKI71o8g==} + dev: true + + /@api.global/typedrequest@3.0.4: + resolution: {integrity: sha512-8UThH9c3MxdSLiON8UN1CPXooU6Mp0eleFhVS3QB2OUsYqgEGn/EzuMt+cMIv/+ESSS6zcTpHvAhZ8ZMLfpL8A==} + dependencies: + '@api.global/typedrequest-interfaces': 3.0.1 + '@push.rocks/isounique': 1.0.5 + '@push.rocks/lik': 6.0.12 + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/webrequest': 3.0.34 + dev: true + + /@api.global/typedserver@3.0.20: + resolution: {integrity: sha512-bJA79KxGD24xqOMNZCovMK13Qf1x0hhzwQ+vlfbqvnKkMAieNbfiTfYcrMsfmTSMMDP0rEi9JEBW8tFSt4bn5g==} + dependencies: + '@api.global/typedrequest': 3.0.4 + '@api.global/typedrequest-interfaces': 3.0.1 + '@api.global/typedsocket': 3.0.0 + '@push.rocks/lik': 6.0.12 + '@push.rocks/smartchok': 1.0.32 + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartenv': 5.0.12 + '@push.rocks/smartfeed': 1.0.11 + '@push.rocks/smartfile': 11.0.4 + '@push.rocks/smartlog': 3.0.3 + '@push.rocks/smartlog-destination-devtools': 1.0.10 + '@push.rocks/smartmanifest': 2.0.2 + '@push.rocks/smartmime': 1.0.6 + '@push.rocks/smartopen': 2.0.0 + '@push.rocks/smartpath': 5.0.11 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smartrequest': 2.0.21 + '@push.rocks/smartrx': 3.0.7 + '@push.rocks/smartsitemap': 2.0.3 + '@push.rocks/smartstream': 3.0.30 + '@push.rocks/smarttime': 4.0.6 + '@push.rocks/webstore': 2.0.13 + '@tsclass/tsclass': 4.0.46 + '@types/express': 4.17.21 + body-parser: 1.20.2 + cors: 2.8.5 + express: 4.18.2 + express-force-ssl: 0.3.2 + lit: 3.1.1 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@api.global/typedsocket@3.0.0: + resolution: {integrity: sha512-ui+6MLd99iTN/lC+iC/FKPRjzVyiZ4PrmlU6ptbCtbBj3cSOXHx+RRGF54+be2xHodf4FOgwFv/GZdW8LtO3vg==} + dependencies: + '@api.global/typedrequest': 3.0.4 + '@api.global/typedrequest-interfaces': 3.0.1 + '@push.rocks/isohash': 2.0.1 + '@push.rocks/smartjson': 5.0.10 + '@push.rocks/smartrx': 3.0.7 + '@push.rocks/smartsocket': 2.0.24 + '@push.rocks/smartstring': 4.0.13 + '@push.rocks/smarturl': 3.0.7 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@apiglobal/typedrequest-interfaces@1.0.20: + resolution: {integrity: sha512-ybsDtavYbzGJYSLodSbkxDvSLYtfMzBTuNZDJpiANt1rZA2MO/GCq8zk5MVLlrUUQIr/7oxPGWqxi1QDwR+RHQ==} + dev: true + + /@apiglobal/typedrequest-interfaces@2.0.1: + resolution: {integrity: sha512-Oi7pNU4vKo5UvcCJmqkH43Us237Ws/Pp/WDYnwnonRnTmIMd+6QjNfN/gXcPnP6tbamk8r8Xzcz9mgnSDM2ysw==} + dev: true + + /@babel/code-frame@7.23.5: + resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.23.4 + chalk: 2.4.2 + dev: true + + /@babel/helper-validator-identifier@7.22.20: + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/highlight@7.23.4: + resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + chalk: 2.4.2 + js-tokens: 4.0.0 + dev: true + + /@cspotcode/source-map-support@0.8.1: + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + dev: true + + /@esbuild/aix-ppc64@0.19.12: + resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm64@0.19.12: + resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.19.12: + resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.19.12: + resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.19.12: + resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.19.12: + resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64@0.19.12: + resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.19.12: + resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.19.12: + resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.19.12: + resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.19.12: + resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.19.12: + resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.19.12: + resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.19.12: + resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.19.12: + resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.19.12: + resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.19.12: + resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.19.12: + resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.19.12: + resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.19.12: + resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.19.12: + resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.19.12: + resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.19.12: + resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@git.zone/tsbuild@2.1.72: + resolution: {integrity: sha512-rVWM98chNjkt8pXdF5knGErZjM3GPnRXZYHVGECptxNvvhTol2DliM1OP8k3p3X5UOwEPV2sQVe//XzXs3BcUw==} + hasBin: true + dependencies: + '@push.rocks/early': 4.0.4 + '@push.rocks/smartcli': 4.0.8 + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartfile': 11.0.4 + '@push.rocks/smartlog': 3.0.3 + '@push.rocks/smartpath': 5.0.11 + '@push.rocks/smartpromise': 4.0.3 + typescript: 5.3.3 + dev: true + + /@git.zone/tsbundle@2.0.15: + resolution: {integrity: sha512-ZrPkScaBQ7hHx6BUchRFfPB9tvb7RlNXwjk9qjkp6AcBcF38JgLcu/UDKDqRsuaFJpkK9oclyhA5bDA7SjXWZg==} + hasBin: true + dependencies: + '@push.rocks/early': 4.0.4 + '@push.rocks/smartcli': 4.0.8 + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartfile': 11.0.4 + '@push.rocks/smartlog': 3.0.3 + '@push.rocks/smartlog-destination-local': 9.0.1 + '@push.rocks/smartpath': 5.0.11 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smartspawn': 3.0.2 + '@types/html-minifier': 4.0.5 + esbuild: 0.19.12 + html-minifier: 4.0.0 + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@git.zone/tsrun@1.2.46(@types/node@20.11.10): + resolution: {integrity: sha512-8miFVBle9Mnjx+uPGI/P+EuWcIOXWjBAkdjN5IYbdp5Ytt4xQODCLh4JSnC9h56UeU1nUxCAxZeJs2e9TXrivA==} + hasBin: true + dependencies: + '@push.rocks/smartfile': 10.0.41 + '@push.rocks/smartshell': 3.0.3 + ts-node: 10.9.2(@types/node@20.11.10)(typescript@5.1.6) + typescript: 5.1.6 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + - '@types/node' + dev: true + + /@git.zone/tstest@1.0.86(@types/node@20.11.10)(sinon@17.0.1): + resolution: {integrity: sha512-ec95MNeA21L+ob+lvLVCmwPTTC1BY+v/JHLYZ9DOZ9+9buLgx+cJ7VkwGBJCnlWJtqEtJosUrFKTih36iNuT3g==} + hasBin: true + dependencies: + '@api.global/typedserver': 3.0.20 + '@git.zone/tsbundle': 2.0.15 + '@git.zone/tsrun': 1.2.46(@types/node@20.11.10) + '@push.rocks/consolecolor': 2.0.1 + '@push.rocks/smartbrowser': 2.0.6 + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartfile': 11.0.4 + '@push.rocks/smartlog': 3.0.3 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smartshell': 3.0.3 + '@push.rocks/tapbundle': 5.0.15(sinon@17.0.1) + '@types/ws': 8.5.10 + figures: 6.0.1 + ws: 8.16.0 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + - '@types/node' + - bufferutil + - encoding + - sinon + - supports-color + - utf-8-validate + dev: true + + /@isaacs/cliui@8.0.2: + resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} + engines: {node: '>=12'} + dependencies: + string-width: 5.1.2 + string-width-cjs: /string-width@4.2.3 + strip-ansi: 7.1.0 + strip-ansi-cjs: /strip-ansi@6.0.1 + wrap-ansi: 8.1.0 + wrap-ansi-cjs: /wrap-ansi@7.0.0 + dev: true + + /@jridgewell/resolve-uri@3.1.1: + resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/sourcemap-codec@1.4.15: + resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + dev: true + + /@jridgewell/trace-mapping@0.3.9: + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + dependencies: + '@jridgewell/resolve-uri': 3.1.1 + '@jridgewell/sourcemap-codec': 1.4.15 + dev: true + + /@leichtgewicht/ip-codec@2.0.4: + resolution: {integrity: sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==} + dev: true + + /@lit-labs/ssr-dom-shim@1.1.2: + resolution: {integrity: sha512-jnOD+/+dSrfTWYfSXBXlo5l5f0q1UuJo3tkbMDCYA2lKUYq79jaxqtGEvnRoh049nt1vdo1+45RinipU6FGY2g==} + dev: true + + /@lit/reactive-element@2.0.3: + resolution: {integrity: sha512-e067EuTNNgOHm1tZcc0Ia7TCzD/9ZpoPegHKgesrGK6pSDRGkGDAQbYuQclqLPIoJ9eC8Kb9mYtGryWcM5AywA==} + dependencies: + '@lit-labs/ssr-dom-shim': 1.1.2 + dev: true + + /@nodelib/fs.scandir@2.1.5: + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + dev: true + + /@nodelib/fs.stat@2.0.5: + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + dev: true + + /@nodelib/fs.walk@1.2.8: + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.17.0 + dev: true + + /@open-wc/chai-dom-equals@0.12.36: + resolution: {integrity: sha512-Gt1fa37h4rtWPQGETSU4n1L678NmMi9KwHM1sH+JCGcz45rs8DBPx7MUVeGZ+HxRlbEI5t9LU2RGGv6xT2OlyA==} + dependencies: + '@open-wc/semantic-dom-diff': 0.13.21 + '@types/chai': 4.3.11 + dev: true + + /@open-wc/dedupe-mixin@1.4.0: + resolution: {integrity: sha512-Sj7gKl1TLcDbF7B6KUhtvr+1UCxdhMbNY5KxdU5IfMFWqL8oy1ZeAcCANjoB1TL0AJTcPmcCFsCbHf8X2jGDUA==} + dev: true + + /@open-wc/scoped-elements@1.3.7: + resolution: {integrity: sha512-q/wKf4sXl7cr1kNfl8z6TLO2TrpXsFMCrfCD51sCEljltwYIXOmI6SnRXmWlnzG37A8AwHRpDXYmjPj2F4gPxA==} + dependencies: + '@open-wc/dedupe-mixin': 1.4.0 + lit-html: 1.4.1 + dev: true + + /@open-wc/semantic-dom-diff@0.13.21: + resolution: {integrity: sha512-BONpjHcGX2zFa9mfnwBCLEmlDsOHzT+j6Qt1yfK3MzFXFtAykfzFjAgaxPetu0YbBlCfXuMlfxI4vlRGCGMvFg==} + dev: true + + /@open-wc/semantic-dom-diff@0.19.9: + resolution: {integrity: sha512-iUL0OPA6PeLQVEEJ/gsgkEiwOGgK4E1KS//zTB+u+OAh0NifNTfxDxIHQa7rEGvplaq2b2zztT2yyzOzj+MlAA==} + dependencies: + '@types/chai': 4.3.11 + '@web/test-runner-commands': 0.6.6 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@open-wc/testing-helpers@1.8.12: + resolution: {integrity: sha512-+4exEHYvnFqI1RGDDIKFHPZ7Ws5NK1epvEku3zLaOYN3zc+huX19SndNc5+X++v8A+quN/iXbHlh80ROyNaYDA==} + dependencies: + '@open-wc/scoped-elements': 1.3.7 + lit-element: 2.5.1 + lit-html: 1.4.1 + dev: true + + /@open-wc/testing@2.5.33(sinon@17.0.1): + resolution: {integrity: sha512-+EJNs0i+VV4nE+BrG70l2DNGXOZTSrluruaaU06HUSk57ZlKa+kIxWmkLxCOLlbgnQgrPrQWxbs3lgB1tIx/YA==} + dependencies: + '@open-wc/chai-dom-equals': 0.12.36 + '@open-wc/semantic-dom-diff': 0.19.9 + '@open-wc/testing-helpers': 1.8.12 + '@types/chai': 4.3.11 + '@types/chai-dom': 0.0.9 + '@types/mocha': 5.2.7 + '@types/sinon-chai': 3.2.12 + chai: 4.4.1 + chai-a11y-axe: 1.5.0 + chai-dom: 1.12.0(chai@4.4.1) + mocha: 6.2.3 + sinon-chai: 3.7.0(chai@4.4.1)(sinon@17.0.1) + transitivePeerDependencies: + - bufferutil + - sinon + - supports-color + - utf-8-validate + dev: true + + /@pkgjs/parseargs@0.11.0: + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + engines: {node: '>=14'} + requiresBuild: true + dev: true + optional: true + + /@push.rocks/consolecolor@2.0.1: + resolution: {integrity: sha512-iQx+sjxmvhRXjnv8aMiaZu125ZWfyZKSylCvKUNjVrdhkmP2uPy2VWsvyRBS4UiieYHTY/i+HpQiFv4QZV2/Fg==} + dependencies: + ansi-256-colors: 1.1.0 + dev: true + + /@push.rocks/early@4.0.4: + resolution: {integrity: sha512-ak6/vqZ1PlFV08fSFQ6UwiBrr+K6IsfieZWWzT7eex1Ls6GvWEi8wZ3REFDPJq/qckNLWSgEy0EsqzRtltkaCA==} + dependencies: + '@push.rocks/consolecolor': 2.0.1 + '@push.rocks/smartpromise': 4.0.3 + dev: true + + /@push.rocks/isohash@2.0.1: + resolution: {integrity: sha512-UulhEui8O9Ei9fSqTldsB73TUmAFNqEBk82tHsJSLLpNK9gJZQE82iaSNsQUakoUQ2c9KueueMfwC3IoDaYRrQ==} + dependencies: + '@pushrocks/smartenv': 5.0.5 + '@pushrocks/smarthash': 3.0.2 + dev: true + + /@push.rocks/isounique@1.0.5: + resolution: {integrity: sha512-Z0BVqZZOCif1THTbIKWMgg0wxCzt9CyBtBBqQJiZ+jJ0KlQFrQHNHrPt81/LXe/L4x0cxWsn0bpL6W5DNSvNLw==} + dev: true + + /@push.rocks/lik@6.0.12: + resolution: {integrity: sha512-/vzlOZ26gCmXZz67LeM2hJ+aNM49Jxvf3FKxLMXHhJwffd3LcV96MYbMfKzKR/za/bh5Itf3a6UjLL5mmN6Pew==} + dependencies: + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartmatch': 2.0.0 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smartrx': 3.0.7 + '@push.rocks/smarttime': 4.0.6 + '@types/minimatch': 5.1.2 + '@types/symbol-tree': 3.2.5 + symbol-tree: 3.2.4 + dev: true + + /@push.rocks/smartbrowser@2.0.6: + resolution: {integrity: sha512-Ne+KCVhV/DROc1rHRRw59K6h0+LpQAK9fdOUtgDZ7laLPmB/tmnbUh3IuRDNcIY1iVA9pydoobwjnTjVgio9eQ==} + dependencies: + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartpdf': 3.0.16 + '@push.rocks/smartpuppeteer': 2.0.2 + '@push.rocks/smartunique': 3.0.6 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /@push.rocks/smartcache@1.0.16: + resolution: {integrity: sha512-UAXf74eDuH4/RebJhydIbHlYVR3ACYJjniEY/9ZePblu7bIPgwFZqLBE9g1lcKVogbH9yY62dk3rSpgBzenyfQ==} + dependencies: + '@pushrocks/smartdelay': 2.0.13 + '@pushrocks/smarterror': 2.0.1 + '@pushrocks/smarthash': 3.0.2 + '@pushrocks/smartpromise': 3.1.10 + '@pushrocks/smarttime': 4.0.1 + dev: true + + /@push.rocks/smartchok@1.0.32: + resolution: {integrity: sha512-bBJ4UX3jjItZo0mdDxQcDdRqbuIyCeDo4XXvkX2yLqkHJHFxQbL2lTDrX4l7cTaQ7361AYSsvOsBkZyPvCN6mg==} + dependencies: + '@push.rocks/lik': 6.0.12 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smartrx': 3.0.7 + '@tempfix/watcher': 2.3.0 + dev: true + + /@push.rocks/smartcli@4.0.8: + resolution: {integrity: sha512-B4F3nqq7ko8tev1wxGdFnh/zSDDP8Q9LpEOb3wTf0jayyhYetFQ7n6zi4J9fhXYBKPkJSyQEBoOfRmgJyeLHkA==} + dependencies: + '@push.rocks/lik': 6.0.12 + '@push.rocks/smartlog': 3.0.3 + '@push.rocks/smartparam': 1.1.10 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smartrx': 3.0.7 + yargs-parser: 21.1.1 + dev: true + + /@push.rocks/smartdelay@3.0.5: + resolution: {integrity: sha512-mUuI7kj2f7ztjpic96FvRIlf2RsKBa5arw81AHNsndbxO6asRcxuWL8dTVxouEIK8YsBUlj0AsrCkHhMbLQdHw==} + dependencies: + '@push.rocks/smartpromise': 4.0.3 + dev: true + + /@push.rocks/smartenv@5.0.12: + resolution: {integrity: sha512-tDEFwywzq0FNzRYc9qY2dRl2pgQuZG0G2/yml2RLWZWSW+Fn1EHshnKOGHz8o77W7zvu4hTgQQX42r/JY5XHTg==} + dependencies: + '@push.rocks/smartpromise': 4.0.3 + dev: true + + /@push.rocks/smartexpect@1.0.21: + resolution: {integrity: sha512-SelJxXMYeF5VEZk0oPgcjTCM2D7vqOTUgVX/vnnGxZAl9d068LD12/BWLwKCEp0dsV3NT8rBuXJTFPZYjdsApg==} + dependencies: + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartpromise': 4.0.3 + fast-deep-equal: 3.1.3 + dev: true + + /@push.rocks/smartfeed@1.0.11: + resolution: {integrity: sha512-02uhXxQamgfBo3T12FsAdfyElnpoWuDUb08B2AE60DbIaukVx/7Mi17xwobApY1flNSr5StZDt8N8vxPhBhIXw==} + dependencies: + '@tsclass/tsclass': 3.0.48 + feed: 4.2.2 + rss-parser: 3.13.0 + dev: true + + /@push.rocks/smartfile-interfaces@1.0.7: + resolution: {integrity: sha512-MeOl/200UOvSO4Pgq/DVFiBVZpL9gjOBQM+4XYNjSxda8c6VBvchHAntaFLQUlO8U1ckNaP9i+nMO4O4/0ymyw==} + dev: true + + /@push.rocks/smartfile@10.0.41: + resolution: {integrity: sha512-xOOy0duI34M2qrJZggpk51EHGXmg9+mBL1Q55tNiQKXzfx89P3coY1EAZG8tvmep3qB712QEKe7T+u04t42Kjg==} + dependencies: + '@push.rocks/lik': 6.0.12 + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartfile-interfaces': 1.0.7 + '@push.rocks/smarthash': 3.0.4 + '@push.rocks/smartjson': 5.0.10 + '@push.rocks/smartmime': 1.0.6 + '@push.rocks/smartpath': 5.0.11 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smartrequest': 2.0.21 + '@push.rocks/smartstream': 2.0.8 + '@types/fs-extra': 11.0.4 + '@types/glob': 8.1.0 + '@types/js-yaml': 4.0.9 + fs-extra: 11.2.0 + glob: 10.3.10 + js-yaml: 4.1.0 + dev: true + + /@push.rocks/smartfile@11.0.4: + resolution: {integrity: sha512-NXAyqYE5zNUJ9Mu/t2oWUKu21CRUI4Dvlm56rKBSczCq5xeC7EwmamTzL3Nyn6Tmu1jBpYktYL4zIx17JJOB7w==} + dependencies: + '@push.rocks/lik': 6.0.12 + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartfile-interfaces': 1.0.7 + '@push.rocks/smarthash': 3.0.4 + '@push.rocks/smartjson': 5.0.10 + '@push.rocks/smartmime': 1.0.6 + '@push.rocks/smartpath': 5.0.11 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smartrequest': 2.0.21 + '@push.rocks/smartstream': 3.0.30 + '@types/fs-extra': 11.0.4 + '@types/glob': 8.1.0 + '@types/js-yaml': 4.0.9 + fs-extra: 11.2.0 + glob: 10.3.10 + js-yaml: 4.1.0 + dev: true + + /@push.rocks/smarthash@3.0.4: + resolution: {integrity: sha512-HJ/fSx41jm0CvSaqMLa6b2nuNK5rHAqAeAq3dAB7Sq9BCPm2M0J5ZVDTzEAH8pS91XYniUiwuE0jwPERNn9hmw==} + dependencies: + '@push.rocks/smartjson': 5.0.10 + '@push.rocks/smartpromise': 4.0.3 + '@types/through2': 2.0.41 + through2: 4.0.2 + dev: true + + /@push.rocks/smartjson@5.0.10: + resolution: {integrity: sha512-yuntSMGZ+XNHMrbS9RxotaD+eOgoNTcuDoWsttis+N3Mkc9DIam0pt/ER4NU8TgfMmhT/hKwQH+3DJceDzntoA==} + dependencies: + '@push.rocks/smartstring': 4.0.13 + '@types/buffer-json': 2.0.3 + buffer-json: 2.0.0 + fast-json-stable-stringify: 2.1.0 + lodash.clonedeep: 4.5.0 + dev: true + + /@push.rocks/smartlog-destination-devtools@1.0.10: + resolution: {integrity: sha512-E6xRx5vhR7gh9peXjUyBwNj0H0MeaBjh+PY++PbOhUF4NDMaEuswRLRs+UN9bfbLXZQl2i4hYD1MNCesHGTVgA==} + dependencies: + '@pushrocks/smartlog-interfaces': 2.0.23 + dev: true + + /@push.rocks/smartlog-destination-local@9.0.1: + resolution: {integrity: sha512-JCX73z4ORTI7XEMmWFYp2GkWwpPgXDZzIQBTrBOlo6U+EAERWZhZDpLfVK+qKuZBQ86E0gqTlcUaOl3k1vp1GA==} + dependencies: + '@pushrocks/consolecolor': 2.0.1 + '@pushrocks/smartlog-interfaces': 3.0.0 + '@pushrocks/smartpromise': 4.0.2 + dev: true + + /@push.rocks/smartlog-interfaces@3.0.0: + resolution: {integrity: sha512-dfRqiSolGQwaF9gWmkixWOoXZxcWBjK3u6A1CpcfhCbVr2VSUMIrZ5t74/DgdfedsTrhDqoD0NGezsMXF2pFHQ==} + dependencies: + '@apiglobal/typedrequest-interfaces': 2.0.1 + dev: true + + /@push.rocks/smartlog@3.0.3: + resolution: {integrity: sha512-E4UUSdbrf0TdSqI7LrUa3jgYQGKT6+ybSHuRcopFDt0W2/tBpY+/vPyAApJIa8iGFKJoi3oSTgYJbK90SwQwKg==} + dependencies: + '@push.rocks/isounique': 1.0.5 + '@push.rocks/smartlog-interfaces': 3.0.0 + dev: true + + /@push.rocks/smartmanifest@2.0.2: + resolution: {integrity: sha512-QGc5C9vunjfUbYsPGz5bynV/mVmPHkrQDkWp8ZO8VJtK1GZe+njgbrNyxn2SUHR0IhSAbSXl1j4JvBqYf5eTVg==} + dev: true + + /@push.rocks/smartmatch@2.0.0: + resolution: {integrity: sha512-MBzP++1yNIBeox71X6VxpIgZ8m4bXnJpZJ4nWVH6IWpmO38MXTu4X0QF8tQnyT4LFcwvc9iiWaD15cstHa7Mmw==} + dependencies: + matcher: 5.0.0 + dev: true + + /@push.rocks/smartmime@1.0.6: + resolution: {integrity: sha512-PHd+I4UcsnOATNg8wjDsSAmmJ4CwQFrQCNzd0HSJMs4ZpiK3Ya91almd6GLpDPU370U4HFh4FaPF4eEAI6vkJQ==} + dependencies: + '@types/mime-types': 2.1.4 + mime-types: 2.1.35 + dev: true + + /@push.rocks/smartnetwork@3.0.2: + resolution: {integrity: sha512-s6CNGzQ1n/d/6cOKXbxeW6/tO//dr1woLqI01g7XhqTriw0nsm2G2kWaZh2J0VOguGNWBgQVCIpR0LjdRNWb3g==} + dependencies: + '@pushrocks/smartping': 1.0.8 + '@pushrocks/smartpromise': 3.1.10 + '@pushrocks/smartstring': 4.0.7 + '@types/default-gateway': 3.0.1 + isopen: 1.3.0 + public-ip: 6.0.1 + systeminformation: 5.21.24 + dev: true + + /@push.rocks/smartopen@2.0.0: + resolution: {integrity: sha512-eVT0GhtQ2drb95j/kktYst/Toh1zCwCqjTJFYtaYFUnnBnBUajPtBZDFnPQo01DN8JxoeCTo8jggq+PCvzcfww==} + dependencies: + open: 8.4.2 + dev: true + + /@push.rocks/smartparam@1.1.10: + resolution: {integrity: sha512-2WDAUtc7GH+E0QszsiuXRdLPnJ/edlS2zPtFgfNpA0LJ8tJ5J9lyx6zhM39k4rKzKtK7bnjWHDb2tHE9zaOBYw==} + deprecated: deprecated in favour of @push.rocks/smartobject + dependencies: + '@push.rocks/smartpromise': 4.0.3 + minimatch: 9.0.3 + dev: true + + /@push.rocks/smartpath@5.0.11: + resolution: {integrity: sha512-dqdd7KTby0AdaWYC9gVoHDTUIixFhEvo+mmdaTdNshZsfHNkm/EDV25dA+9gJ8/yoyuCYmrwmByNYy9a+xFUeQ==} + dev: true + + /@push.rocks/smartpdf@3.0.16: + resolution: {integrity: sha512-W5tR1rlgrs7MoXEEGgnuJOAGLFxXTHDCgHpdhrtlt5M3t/ELZvaJoyMNRwrt3BbWEAb86dr4QwWSt380Q3MhfQ==} + dependencies: + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartfile': 10.0.41 + '@push.rocks/smartnetwork': 3.0.2 + '@push.rocks/smartpath': 5.0.11 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smartpuppeteer': 2.0.2 + '@push.rocks/smartunique': 3.0.6 + '@tsclass/tsclass': 4.0.46 + '@types/express': 4.17.21 + express: 4.18.2 + pdf-merger-js: 3.4.0 + pdf2json: 2.1.0 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /@push.rocks/smartpromise@4.0.3: + resolution: {integrity: sha512-z3lIso4/6KK3c6NFTVGZ7AOBsGURf8ha3qQtX/OxjZFk5dqS//8PLd0XqghVdIaUlRGmJ7Sfds/efZERWn1tAg==} + dev: true + + /@push.rocks/smartpuppeteer@2.0.2: + resolution: {integrity: sha512-EcYCT0PX++WjfHp7W5UYX3t8x5gSNpJMMUvhA7SHz8b2t76ItslNWxprRcF0CUQyN1fozbf5StZf7dwdGc/dIA==} + dependencies: + '@pushrocks/smartdelay': 2.0.13 + '@pushrocks/smartshell': 2.0.30 + puppeteer: 15.5.0 + tree-kill: 1.2.2 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /@push.rocks/smartrequest@2.0.21: + resolution: {integrity: sha512-btk9GbiMNxNcEgJEqTq9qMFJ/6ua6oG4q49v+8ujKAXU50vFn1WQ/H0VAyeu9LMa5GCcRwUhNNDdwpLVGVbrBg==} + dependencies: + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smarturl': 3.0.7 + agentkeepalive: 4.5.0 + form-data: 4.0.0 + dev: true + + /@push.rocks/smartrx@3.0.7: + resolution: {integrity: sha512-qCWy0s3RLAgGSnaw/Gu0BNaJ59CsI6RK5OJDCCqxc7P2X/S755vuLtnAR5/0dEjdhCHXHX9ytPZx+o9g/CNiyA==} + dependencies: + '@push.rocks/smartpromise': 4.0.3 + rxjs: 7.8.1 + dev: true + + /@push.rocks/smartshell@3.0.3: + resolution: {integrity: sha512-S4RXI76ltPetdJ8Gv4HlnlhR/hXDV8QmSU7TdhLEe171ZzfouAyt9XZ4MFDCtjk3VQ4Mw+zz4mSDaACXP/QdlQ==} + dependencies: + '@pushrocks/smartdelay': 3.0.1 + '@pushrocks/smartexit': 1.0.20 + '@pushrocks/smartpromise': 4.0.2 + '@types/which': 3.0.3 + tree-kill: 1.2.2 + which: 3.0.1 + dev: true + + /@push.rocks/smartsitemap@2.0.3: + resolution: {integrity: sha512-jIcms8V1b2mt3dS4PKNlLR1DRC8pCDWMRVbnyM/2+snZOJZonQRlQzAyX8No0EfLbfdrfnxv2IjPX13X29Re6g==} + dependencies: + '@push.rocks/smartcache': 1.0.16 + '@push.rocks/smartfeed': 1.0.11 + '@push.rocks/smartxml': 1.0.8 + '@push.rocks/smartyaml': 2.0.5 + '@push.rocks/webrequest': 3.0.34 + '@tsclass/tsclass': 4.0.46 + dev: true + + /@push.rocks/smartsocket@2.0.24: + resolution: {integrity: sha512-Glqv1Zi5TXgD+04P8OvTpiytyfrQxTPv67qAwZizAVVQ2zWJJgKqnIuoHT1zKP8QiKRNer+D58LCxX0ZE2XfzQ==} + dependencies: + '@api.global/typedrequest-interfaces': 3.0.1 + '@api.global/typedserver': 3.0.20 + '@push.rocks/isohash': 2.0.1 + '@push.rocks/isounique': 1.0.5 + '@push.rocks/lik': 6.0.12 + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartenv': 5.0.12 + '@push.rocks/smartjson': 5.0.10 + '@push.rocks/smartlog': 3.0.3 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smartrx': 3.0.7 + '@push.rocks/smarttime': 4.0.6 + engine.io: 6.5.2 + socket.io: 4.7.2 + socket.io-client: 4.7.2 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@push.rocks/smartspawn@3.0.2: + resolution: {integrity: sha512-KdQd64FKIwjHyuuwR/CMP4MXzC08rAE7cjkyQqfJzwZhzJK2Pd/HPwazx0cfZFFWIiz09byYhBwK0rKXRiYEWA==} + dependencies: + '@pushrocks/smartpromise': 3.1.10 + spawn-wrap: 2.0.0 + threads: 1.7.0 + tiny-worker: 2.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@push.rocks/smartstream@2.0.8: + resolution: {integrity: sha512-GlF/9cCkvBHwKa3DK4DO5wjfSgqkj6gAS4TrY9uD5NMHu9RQv4WiNrElTYj7iCEpnZgUnLO3tzw1JA3NRIMnnA==} + dependencies: + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smartrx': 3.0.7 + '@types/from2': 2.3.5 + '@types/through2': 2.0.41 + from2: 2.3.0 + through2: 4.0.2 + dev: true + + /@push.rocks/smartstream@3.0.30: + resolution: {integrity: sha512-+izraXkILJJIy99PzP2LYahaW+g/35bTi/UxD7FeuOYbTaigode6Q3swvs0nrK6yu+A9x6RfoWV4JAJjd3Y87g==} + dependencies: + '@push.rocks/lik': 6.0.12 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smartrx': 3.0.7 + dev: true + + /@push.rocks/smartstring@4.0.13: + resolution: {integrity: sha512-iEAch6fYC+VijBYWFfRif5Wj5KxdUgC2Xnn0NNgDFrBmI14HsECcPbZ0YdESawRVD27pLYYZJCCbu/M/Llo1kg==} + dependencies: + '@push.rocks/isounique': 1.0.5 + '@push.rocks/smartenv': 5.0.12 + '@types/randomatic': 3.1.5 + buffer: 6.0.3 + crypto-random-string: 5.0.0 + js-base64: 3.7.6 + normalize-newline: 4.1.0 + randomatic: 3.1.1 + strip-indent: 4.0.0 + url: 0.11.3 + dev: true + + /@push.rocks/smarttime@4.0.6: + resolution: {integrity: sha512-1whOow0YJw/TbN758TedRRxApoZbsvyxCVpoGjXh7DE/fEEgs7RCr4vVF5jYpyXNQuNMLpKJcTsSfyQ6RvH4Aw==} + dependencies: + '@push.rocks/lik': 6.0.12 + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartpromise': 4.0.3 + croner: 7.0.5 + dayjs: 1.11.10 + is-nan: 1.3.2 + pretty-ms: 8.0.0 + dev: true + + /@push.rocks/smartunique@3.0.6: + resolution: {integrity: sha512-/fvh5BBHiTvZcCH4km2Oh3f0spfcWKr7e0Dp6lAb3rJq+5KiO7fQmI1UcQ9clADUaaJOn8sPzseiLt+kJ2tajw==} + dependencies: + '@types/uuid': 9.0.8 + nanoid: 4.0.2 + uuid: 9.0.1 + dev: true + + /@push.rocks/smarturl@3.0.7: + resolution: {integrity: sha512-nx4EWjQD9JeO7QVbOsxd1PFeDQYoSQOOOYCZ+r7QWXHLJG52iYzgvJDCQyX6p705HDkYMJWozW2ZzhR22qLKbw==} + dev: true + + /@push.rocks/smartxml@1.0.8: + resolution: {integrity: sha512-idrPsBj9t6oxkLZJZgWtyZK6PnQ5BVDbBErk0UfGanXgSWJc+ZEKNYjVqr850+Na3+y0CT6AQdug7pnaokygwg==} + dependencies: + fast-xml-parser: 4.3.3 + dev: true + + /@push.rocks/smartyaml@2.0.5: + resolution: {integrity: sha512-tBcf+HaOIfeEsTMwgUZDtZERCxXQyRsWO8Ar5DjBdiSRchbhVGZQEBzXswMS0W5ZoRenjgPK+4tPW3JQGRTfbg==} + dependencies: + '@types/js-yaml': 3.12.10 + js-yaml: 3.14.1 + dev: true + + /@push.rocks/tapbundle@5.0.15(sinon@17.0.1): + resolution: {integrity: sha512-vVTVmQCovYq9xhif96z7wN8pFiB3UB9MZSkqMDgfNTWhlU19ZZR1azCZn+zXsYxgJmD8wKNYhvZYgdRz73KbBg==} + dependencies: + '@open-wc/testing': 2.5.33(sinon@17.0.1) + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartenv': 5.0.12 + '@push.rocks/smartexpect': 1.0.21 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smarttime': 4.0.6 + transitivePeerDependencies: + - bufferutil + - sinon + - supports-color + - utf-8-validate + dev: true + + /@push.rocks/webrequest@3.0.34: + resolution: {integrity: sha512-3gqJb58ZukPsOcS26ya2M/nAEOP7lMYyc2Syh45ljgwdM3X8PwHquk5pdc1MMdDWAo1aiYrxReEw6BgMCJUlNQ==} + dependencies: + '@push.rocks/smartdelay': 3.0.5 + '@push.rocks/smartenv': 5.0.12 + '@push.rocks/smartjson': 5.0.10 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/webstore': 2.0.13 + dev: true + + /@push.rocks/webstore@2.0.13: + resolution: {integrity: sha512-w5Q3g1TT5SDIXukAAoYVuWud+Y5ysS8qiBqPU00/re895VVZhUOSNJMNU6jyneZigmbWtwSLsxDkZHlsHWpfuA==} + dependencies: + '@apiglobal/typedrequest-interfaces': 2.0.1 + '@push.rocks/lik': 6.0.12 + '@push.rocks/smartenv': 5.0.12 + '@push.rocks/smartjson': 5.0.10 + '@push.rocks/smartpromise': 4.0.3 + '@push.rocks/smartrx': 3.0.7 + fake-indexeddb: 4.0.2 + idb: 7.1.1 + dev: true + + /@pushrocks/consolecolor@2.0.1: + resolution: {integrity: sha512-iOFCHVeFZ2OywbdwSxVI4/wokkcLrXVdHLgvMmkNhJ220eeLgjNZWx3EJo3vNW3zq5ybCSCUIq0878djBxrWpw==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/consolecolor + dependencies: + ansi-256-colors: 1.1.0 + dev: true + + /@pushrocks/isounique@1.0.5: + resolution: {integrity: sha512-XYeoKGkmIdsWX64NlPA1fuA41n/1bQ7LdYXytlU/QqYeW7ojgA0ARRhBSh/2phL6o0Jpw6K/7gJ8jc7ab/Tc+w==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/isounique + dev: true + + /@pushrocks/lik@4.0.22: + resolution: {integrity: sha512-dg6Du7nr/SLU80yJw7a0zk2xX9Vc8SCLZaQMmSRBlsnL1/Z7qpWDOtpRC9VlL9vTLenbvwGTvPWMpOKyyNbiiA==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/lik + dependencies: + '@pushrocks/smartdelay': 2.0.13 + '@pushrocks/smartmatch': 1.0.7 + '@pushrocks/smartpromise': 3.1.10 + '@pushrocks/smartrx': 2.0.27 + '@pushrocks/smarttime': 3.0.50 + '@types/minimatch': 3.0.5 + symbol-tree: 3.2.4 + dev: true + + /@pushrocks/lik@5.0.7: + resolution: {integrity: sha512-fIxcrafl127+yErfedIurafCbiY2VwuuMlbNLjKrMKnFswol4y/anjXVRZ4euWUBck0KOfnBB0VuutcmlfYUqA==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/lik + dependencies: + '@pushrocks/smartdelay': 2.0.13 + '@pushrocks/smartmatch': 1.0.7 + '@pushrocks/smartpromise': 3.1.10 + '@pushrocks/smartrx': 2.0.27 + '@pushrocks/smarttime': 3.0.50 + '@types/minimatch': 3.0.5 + symbol-tree: 3.2.4 + dev: true + + /@pushrocks/lik@6.0.2: + resolution: {integrity: sha512-jO85PCb4gULfZbLoVpXb9HIR9Wgoigq6Zjcp1JqHOgM4KB38IZrU+HPWPWWMErAOOQmmYvVCdl4gkrkO/Rzn4w==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/lik + dependencies: + '@pushrocks/smartdelay': 2.0.13 + '@pushrocks/smartmatch': 2.0.0 + '@pushrocks/smartpromise': 3.1.10 + '@pushrocks/smartrx': 3.0.2 + '@pushrocks/smarttime': 4.0.1 + '@types/minimatch': 5.1.2 + '@types/symbol-tree': 3.2.5 + symbol-tree: 3.2.4 + dev: true + + /@pushrocks/smartdelay@2.0.13: + resolution: {integrity: sha512-s6Wh0BHWMfZ5VYONQwpxOYX1JeC9RKA0O9TxEzfZ6FCw2oNQb2QUPCixT9rsceKwva4+atKRw/RfU+Z7aJDmsA==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartdelay + dependencies: + '@pushrocks/smartpromise': 3.1.10 + dev: true + + /@pushrocks/smartdelay@3.0.1: + resolution: {integrity: sha512-I+i/QhC6kLsXsWyW19UgD1vH2r1YWVxK19VMxt2CEuvxMyC6tuCd0vqud9vv5JxaxsJwxWlOsrURkgL4tXeILQ==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartdelay + dependencies: + '@pushrocks/smartpromise': 4.0.2 + dev: true + + /@pushrocks/smartenv@5.0.5: + resolution: {integrity: sha512-VWON1OJ4qV2/9hzJbgRquRekaO9am3b8W82tgCwgO6LBg23ea2tanfd+gESVMbRFduxHVoFLvlhSBcDGM5zsLA==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartenv + dependencies: + '@pushrocks/smartpromise': 3.1.10 + dev: true + + /@pushrocks/smarterror@2.0.1: + resolution: {integrity: sha512-3OrF5me+/sy5VgwR/tfCqs7qhb0Ywzgn8tTThRUZnCGas0aindISzMiW7cIro3RlFykmtPmdTztC9Ostu2ioeA==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smarterror + dependencies: + clean-stack: 1.3.0 + make-error-cause: 2.3.0 + dev: true + + /@pushrocks/smartexit@1.0.20: + resolution: {integrity: sha512-u/KgA7s2zAtZ7gZvL13HZbO3mZATvjfCLU8Ez6h8VweG8UsIBVaPfYziMDCmJOWIPYLGzEW8eG/u4mCHuyLBow==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartexit + dependencies: + '@pushrocks/lik': 4.0.22 + '@pushrocks/smartdelay': 2.0.13 + dev: true + + /@pushrocks/smarthash@3.0.2: + resolution: {integrity: sha512-jXW4f8k6iqOQRvkCmXMID1C+qXyNvUMKm7apPETxnO+L172VlzxP1dml0Ey1+vjfpU2luKCteJWX7W95sOdLDg==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smarthash + dependencies: + '@pushrocks/smartjson': 5.0.6 + '@pushrocks/smartpromise': 3.1.10 + '@types/through2': 2.0.41 + through2: 4.0.2 + dev: true + + /@pushrocks/smartjson@5.0.6: + resolution: {integrity: sha512-9OJbnRgLTaCRQz+pqu5tB3ZCqRs5Zh0hnBe7t7URE+TgwIZ8aiELUIbWRkgn4mSGVzHyL6pqTyIowP6AjUCG3w==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartjson + dependencies: + '@pushrocks/smartstring': 4.0.7 + '@types/buffer-json': 2.0.3 + buffer-json: 2.0.0 + fast-json-stable-stringify: 2.1.0 + lodash.clonedeep: 4.5.0 + dev: true + + /@pushrocks/smartlog-interfaces@2.0.23: + resolution: {integrity: sha512-tXqwfrekGxGZJB72BFQppywk7413hXVDgcJNeU+kY6xvmzVjf2HxOMbFYhewh1+p4uai1u9n0xcMb0qbbPy4/Q==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartlog-interfaces + dependencies: + '@apiglobal/typedrequest-interfaces': 1.0.20 + dev: true + + /@pushrocks/smartlog-interfaces@3.0.0: + resolution: {integrity: sha512-yjppiLLJHBcrXTJJusDbFTvHq0RTMl3LnhvWAhyyy8U0O4VkJxIls1t5mS6jsEwxogP88+0flQIWknNJeB913A==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartlog-interfaces + dependencies: + '@apiglobal/typedrequest-interfaces': 2.0.1 + dev: true + + /@pushrocks/smartmatch@1.0.7: + resolution: {integrity: sha512-D+lK5HIKO4Kj1Jm/ycKvy1VzDJ3V6ucHqmf5DMBFdm18BrMj2Zb6M7wN8HUKtkfHvOI7ig85JMuANSEyO7kAPg==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartmatch + dependencies: + matcher: 3.0.0 + dev: true + + /@pushrocks/smartmatch@2.0.0: + resolution: {integrity: sha512-PLvBNVeuY9BERNLq3PFDkhnHHc0RpilEGHd4aUI5XRFlZF++LETdLxPbxw+DHbvHlkUf/nep09f7rrL9Tqub1Q==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartmatch + dependencies: + matcher: 5.0.0 + dev: true + + /@pushrocks/smartping@1.0.8: + resolution: {integrity: sha512-VM2gfS1sTuycj/jHyDa0lDntkPe7/JT0b2kGsy265RkichAJZkoEp3fboRJH/WAdzM8T4Du64JYgZkc8v2HHQg==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartping + dependencies: + '@types/ping': 0.4.4 + ping: 0.4.4 + dev: true + + /@pushrocks/smartpromise@3.1.10: + resolution: {integrity: sha512-VeTurbZ1+ZMxBDJk1Y1LV8SN9xLI+oDXKVeCFw41FAGEKOUEqordqFpi6t+7Vhe/TXUZzCVpZ5bXxAxrGf8yTQ==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartpromise + dev: true + + /@pushrocks/smartpromise@4.0.2: + resolution: {integrity: sha512-bqorOaGXPOuiOSV81luTKrTghg4O4NBRD0zyv7TIqmrMGf4a0uoozaUMp1X8vQdZW+y0gTzUJP9wkzAE6Cci0g==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartpromise + dev: true + + /@pushrocks/smartrx@2.0.27: + resolution: {integrity: sha512-aFRpGxDZgHH1mpmkRBTFwuIVqFiDxk22n2vX2gW4hntV0nJGlt9M9dixMFFXGUjabwX9hHW7y60QPJm2rKaypA==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartrx + dependencies: + '@pushrocks/smartpromise': 3.1.10 + rxjs: 7.8.1 + dev: true + + /@pushrocks/smartrx@3.0.2: + resolution: {integrity: sha512-uh2ByyE86Q4f1/rpktR29vAMzHgAvAhFZqbvP6Sme9FK57OZG0mqZxDvJMVNP5O+QOn0Chrbl3BZCuRsFF3NUA==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartrx + dependencies: + '@pushrocks/smartpromise': 4.0.2 + rxjs: 7.8.1 + dev: true + + /@pushrocks/smartshell@2.0.30: + resolution: {integrity: sha512-HPgdTFzfzhk2TQau/jVdYNSANlxyBZdqq2vyZ+bZahegVHfH/27Zur5Fk+2vE16VJjJMqP7zcvDITUe2+ipgJg==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartshell + dependencies: + '@pushrocks/smartdelay': 2.0.13 + '@pushrocks/smartexit': 1.0.20 + '@pushrocks/smartpromise': 3.1.10 + '@types/which': 2.0.2 + tree-kill: 1.2.2 + which: 2.0.2 + dev: true + + /@pushrocks/smartstring@4.0.7: + resolution: {integrity: sha512-TxHSar7Cj29E+GOcIj4DeZKWCNVzHKdqnrBRqcBqLqmeYZvzFosLXpFKoaCJDq7MSxuPoCvu5woSdp9YmPXyog==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smartstring + dependencies: + '@pushrocks/isounique': 1.0.5 + '@pushrocks/smartenv': 5.0.5 + '@types/randomatic': 3.1.5 + buffer: 6.0.3 + crypto-random-string: 5.0.0 + js-base64: 3.7.6 + normalize-newline: 4.1.0 + randomatic: 3.1.1 + strip-indent: 4.0.0 + url: 0.11.3 + dev: true + + /@pushrocks/smarttime@3.0.50: + resolution: {integrity: sha512-44NgDuNukCQIlPJFNORcDugp36Yj6HT6eZEWtn4M4HKlTFCQ8De+ztwGg+gRceucJ202zqLRKrXoh8dVdS3BaQ==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smarttime + dependencies: + '@pushrocks/lik': 5.0.7 + '@pushrocks/smartdelay': 2.0.13 + '@pushrocks/smartpromise': 3.1.10 + croner: 4.4.1 + dayjs: 1.11.10 + is-nan: 1.3.2 + pretty-ms: 7.0.1 + dev: true + + /@pushrocks/smarttime@4.0.1: + resolution: {integrity: sha512-5SpUqD3X/2IZCTezCpk48Ss7cDc9QOuQAkeAYnJrRjDL4UCLakA3lBeHXRD/rsIB7S1smtXlayQ/vizfYzdbfw==} + deprecated: This package has been deprecated in favour of the new package at @push.rocks/smarttime + dependencies: + '@pushrocks/lik': 6.0.2 + '@pushrocks/smartdelay': 2.0.13 + '@pushrocks/smartpromise': 3.1.10 + croner: 5.7.0 + dayjs: 1.11.10 + is-nan: 1.3.2 + pretty-ms: 8.0.0 + dev: true + + /@rkusa/linebreak@1.0.0: + resolution: {integrity: sha512-yCSm87XA1aYMgfcABSxcIkk3JtCw3AihNceHY+DnZGLvVP/g2z3UWZbi0xIoYpZWAJEVPr5Zt3QE37Q80wF1pA==} + dependencies: + unicode-trie: 0.3.1 + dev: true + + /@sindresorhus/is@5.6.0: + resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} + engines: {node: '>=14.16'} + dev: true + + /@sinonjs/commons@2.0.0: + resolution: {integrity: sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==} + dependencies: + type-detect: 4.0.8 + dev: true + + /@sinonjs/commons@3.0.1: + resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} + dependencies: + type-detect: 4.0.8 + dev: true + + /@sinonjs/fake-timers@11.2.2: + resolution: {integrity: sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==} + dependencies: + '@sinonjs/commons': 3.0.1 + dev: true + + /@sinonjs/samsam@8.0.0: + resolution: {integrity: sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew==} + dependencies: + '@sinonjs/commons': 2.0.0 + lodash.get: 4.4.2 + type-detect: 4.0.8 + dev: true + + /@sinonjs/text-encoding@0.7.2: + resolution: {integrity: sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==} + dev: true + + /@socket.io/component-emitter@3.1.0: + resolution: {integrity: sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==} + dev: true + + /@szmarczak/http-timer@5.0.1: + resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} + engines: {node: '>=14.16'} + dependencies: + defer-to-connect: 2.0.1 + dev: true + + /@tempfix/watcher@2.3.0: + resolution: {integrity: sha512-a2qVQffcrnetehvwsN+LdipxQ6jejwZLgAvS9/91+C0gP4CKyikY01c0tSs0I4tSL7qHdCw1Fx0quLw+A9uyLA==} + dependencies: + stubborn-fs: 1.2.5 + dev: true + + /@tsclass/tsclass@3.0.48: + resolution: {integrity: sha512-hC65UvDlp9qvsl6OcIZXz0JNiWZ0gyzsTzbXpg215sGxopgbkOLCr6E0s4qCTnweYm95gt2AdY95uP7M7kExaQ==} + dependencies: + type-fest: 2.19.0 + dev: true + + /@tsclass/tsclass@4.0.46: + resolution: {integrity: sha512-UovPUvlozv1ftJp4KW5tt4MP/LQCNP3lSCinjyIrLkopOymczyzONUGvSAAwOBf1XBE9bO0tI4KtRuXWN9XBXQ==} + dependencies: + type-fest: 4.10.1 + dev: true + + /@tsconfig/node10@1.0.9: + resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} + dev: true + + /@tsconfig/node12@1.0.11: + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + dev: true + + /@tsconfig/node14@1.0.3: + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + dev: true + + /@tsconfig/node16@1.0.4: + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + dev: true + + /@types/accepts@1.3.7: + resolution: {integrity: sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==} + dependencies: + '@types/node': 20.11.10 + dev: true + + /@types/babel__code-frame@7.0.6: + resolution: {integrity: sha512-Anitqkl3+KrzcW2k77lRlg/GfLZLWXBuNgbEcIOU6M92yw42vsd3xV/Z/yAHEj8m+KUjL6bWOVOFqX8PFPJ4LA==} + dev: true + + /@types/body-parser@1.19.5: + resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} + dependencies: + '@types/connect': 3.4.38 + '@types/node': 20.11.10 + dev: true + + /@types/buffer-json@2.0.3: + resolution: {integrity: sha512-ItD4UfF3Q5jA+PEV6ZUWEHvlWaXJbd0rpuBKOIrEebM053FHaJddKsgUf0vy7nLSTs44nqFj3Mh8J3TiT0xv4g==} + dev: true + + /@types/chai-dom@0.0.9: + resolution: {integrity: sha512-jj4F2NJog2/GBYsyJ8+NvhnWUBbPY4MUAKLdPJE6+568rw12GGXvj0ycUuP5nndVrnJgozmJAoMTvxvjJATXWw==} + dependencies: + '@types/chai': 4.3.11 + dev: true + + /@types/chai@4.3.11: + resolution: {integrity: sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ==} + dev: true + + /@types/clean-css@4.2.11: + resolution: {integrity: sha512-Y8n81lQVTAfP2TOdtJJEsCoYl1AnOkqDqMvXb9/7pfgZZ7r8YrEyurrAvAoAjHOGXKRybay+5CsExqIH6liccw==} + dependencies: + '@types/node': 20.11.10 + source-map: 0.6.1 + dev: true + + /@types/co-body@6.1.3: + resolution: {integrity: sha512-UhuhrQ5hclX6UJctv5m4Rfp52AfG9o9+d9/HwjxhVB5NjXxr5t9oKgJxN8xRHgr35oo8meUEHUPFWiKg6y71aA==} + dependencies: + '@types/node': 20.11.10 + '@types/qs': 6.9.11 + dev: true + + /@types/connect@3.4.38: + resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} + dependencies: + '@types/node': 20.11.10 + dev: true + + /@types/content-disposition@0.5.8: + resolution: {integrity: sha512-QVSSvno3dE0MgO76pJhmv4Qyi/j0Yk9pBp0Y7TJ2Tlj+KCgJWY6qX7nnxCOLkZ3VYRSIk1WTxCvwUSdx6CCLdg==} + dev: true + + /@types/convert-source-map@2.0.3: + resolution: {integrity: sha512-ag0BfJLZf6CQz8VIuRIEYQ5Ggwk/82uvTQf27RcpyDNbY0Vw49LIPqAxk5tqYfrCs9xDaIMvl4aj7ZopnYL8bA==} + dev: true + + /@types/cookie@0.4.1: + resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} + dev: true + + /@types/cookies@0.9.0: + resolution: {integrity: sha512-40Zk8qR147RABiQ7NQnBzWzDcjKzNrntB5BAmeGCb2p/MIyOE+4BVvc17wumsUqUw00bJYqoXFHYygQnEFh4/Q==} + dependencies: + '@types/connect': 3.4.38 + '@types/express': 4.17.21 + '@types/keygrip': 1.0.6 + '@types/node': 20.11.10 + dev: true + + /@types/cors@2.8.17: + resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} + dependencies: + '@types/node': 20.11.10 + dev: true + + /@types/debounce@1.2.4: + resolution: {integrity: sha512-jBqiORIzKDOToaF63Fm//haOCHuwQuLa2202RK4MozpA6lh93eCBc+/8+wZn5OzjJt3ySdc+74SXWXB55Ewtyw==} + dev: true + + /@types/default-gateway@3.0.1: + resolution: {integrity: sha512-tpu0hp+AOIzwdAHyZPzLE5pCf9uT0pb+xZ76T4S7MrY2YTVq918Q7Q2VQ3KCVQqYxM7nxuCK/SL3X97jBEIeKQ==} + dev: true + + /@types/express-serve-static-core@4.17.42: + resolution: {integrity: sha512-ckM3jm2bf/MfB3+spLPWYPUH573plBFwpOhqQ2WottxYV85j1HQFlxmnTq57X1yHY9awZPig06hL/cLMgNWHIQ==} + dependencies: + '@types/node': 20.11.10 + '@types/qs': 6.9.11 + '@types/range-parser': 1.2.7 + '@types/send': 0.17.4 + dev: true + + /@types/express@4.17.21: + resolution: {integrity: sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==} + dependencies: + '@types/body-parser': 1.19.5 + '@types/express-serve-static-core': 4.17.42 + '@types/qs': 6.9.11 + '@types/serve-static': 1.15.5 + dev: true + + /@types/from2@2.3.5: + resolution: {integrity: sha512-giavnjf3kNlJnE+HpZA1CQ3UKHxgehzsTuIMGda8pGMbOiLYGVNADEskey44OZcADHm/HOoBany8IV+0x28XFw==} + dependencies: + '@types/node': 20.11.10 + dev: true + + /@types/fs-extra@11.0.4: + resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} + dependencies: + '@types/jsonfile': 6.1.4 + '@types/node': 20.11.10 + dev: true + + /@types/glob@8.1.0: + resolution: {integrity: sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==} + dependencies: + '@types/minimatch': 5.1.2 + '@types/node': 20.11.10 + dev: true + + /@types/html-minifier@4.0.5: + resolution: {integrity: sha512-LfE7f7MFd+YUfZnlBz8W43P4NgSObWiqyKapANsWCj63Aqeqli8/9gVsGP4CwC8jPpTTYlTopKCk9rJSuht/ew==} + dependencies: + '@types/clean-css': 4.2.11 + '@types/relateurl': 0.2.33 + '@types/uglify-js': 3.17.4 + dev: true + + /@types/http-assert@1.5.5: + resolution: {integrity: sha512-4+tE/lwdAahgZT1g30Jkdm9PzFRde0xwxBNUyRsCitRvCQB90iuA2uJYdUnhnANRcqGXaWOGY4FEoxeElNAK2g==} + dev: true + + /@types/http-cache-semantics@4.0.4: + resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==} + dev: true + + /@types/http-errors@2.0.4: + resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} + dev: true + + /@types/istanbul-lib-coverage@2.0.6: + resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + dev: true + + /@types/istanbul-lib-report@3.0.3: + resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} + dependencies: + '@types/istanbul-lib-coverage': 2.0.6 + dev: true + + /@types/istanbul-reports@3.0.4: + resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} + dependencies: + '@types/istanbul-lib-report': 3.0.3 + dev: true + + /@types/js-yaml@3.12.10: + resolution: {integrity: sha512-/Mtaq/wf+HxXpvhzFYzrzCqNRcA958sW++7JOFC8nPrZcvfi/TrzOaaGbvt27ltJB2NQbHVAg5a1wUCsyMH7NA==} + dev: true + + /@types/js-yaml@4.0.9: + resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==} + dev: true + + /@types/jsonfile@6.1.4: + resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} + dependencies: + '@types/node': 20.11.10 + dev: true + + /@types/keygrip@1.0.6: + resolution: {integrity: sha512-lZuNAY9xeJt7Bx4t4dx0rYCDqGPW8RXhQZK1td7d4H6E9zYbLoOtjBvfwdTKpsyxQI/2jv+armjX/RW+ZNpXOQ==} + dev: true + + /@types/koa-compose@3.2.8: + resolution: {integrity: sha512-4Olc63RY+MKvxMwVknCUDhRQX1pFQoBZ/lXcRLP69PQkEpze/0cr8LNqJQe5NFb/b19DWi2a5bTi2VAlQzhJuA==} + dependencies: + '@types/koa': 2.14.0 + dev: true + + /@types/koa@2.14.0: + resolution: {integrity: sha512-DTDUyznHGNHAl+wd1n0z1jxNajduyTh8R53xoewuerdBzGo6Ogj6F2299BFtrexJw4NtgjsI5SMPCmV9gZwGXA==} + dependencies: + '@types/accepts': 1.3.7 + '@types/content-disposition': 0.5.8 + '@types/cookies': 0.9.0 + '@types/http-assert': 1.5.5 + '@types/http-errors': 2.0.4 + '@types/keygrip': 1.0.6 + '@types/koa-compose': 3.2.8 + '@types/node': 20.11.10 + dev: true + + /@types/mime-types@2.1.4: + resolution: {integrity: sha512-lfU4b34HOri+kAY5UheuFMWPDOI+OPceBSHZKp69gEyTL/mmJ4cnU6Y/rlme3UL3GyOn6Y42hyIEw0/q8sWx5w==} + dev: true + + /@types/mime@1.3.5: + resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==} + dev: true + + /@types/mime@3.0.4: + resolution: {integrity: sha512-iJt33IQnVRkqeqC7PzBHPTC6fDlRNRW8vjrgqtScAhrmMwe8c4Eo7+fUGTa+XdWrpEgpyKWMYmi2dIwMAYRzPw==} + dev: true + + /@types/minimatch@3.0.5: + resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==} + dev: true + + /@types/minimatch@5.1.2: + resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} + dev: true + + /@types/mocha@5.2.7: + resolution: {integrity: sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==} + dev: true + + /@types/node@20.11.10: + resolution: {integrity: sha512-rZEfe/hJSGYmdfX9tvcPMYeYPW2sNl50nsw4jZmRcaG0HIAb0WYEpsB05GOb53vjqpyE9GUhlDQ4jLSoB5q9kg==} + dependencies: + undici-types: 5.26.5 + dev: true + + /@types/parse5@6.0.3: + resolution: {integrity: sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==} + dev: true + + /@types/ping@0.4.4: + resolution: {integrity: sha512-ifvo6w2f5eJYlXm+HiVx67iJe8WZp87sfa683nlqED5Vnt9Z93onkokNoWqOG21EaE8fMxyKPobE+mkPEyxsdw==} + dev: true + + /@types/qs@6.9.11: + resolution: {integrity: sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==} + dev: true + + /@types/randomatic@3.1.5: + resolution: {integrity: sha512-VCwCTw6qh1pRRw+5rNTAwqPmf6A+hdrkdM7dBpZVmhl7g+em3ONXlYK/bWPVKqVGMWgP0d1bog8Vc/X6zRwRRQ==} + dev: true + + /@types/range-parser@1.2.7: + resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} + dev: true + + /@types/relateurl@0.2.33: + resolution: {integrity: sha512-bTQCKsVbIdzLqZhLkF5fcJQreE4y1ro4DIyVrlDNSCJRRwHhB8Z+4zXXa8jN6eDvc2HbRsEYgbvrnGvi54EpSw==} + dev: true + + /@types/send@0.17.4: + resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} + dependencies: + '@types/mime': 1.3.5 + '@types/node': 20.11.10 + dev: true + + /@types/serve-static@1.15.5: + resolution: {integrity: sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==} + dependencies: + '@types/http-errors': 2.0.4 + '@types/mime': 3.0.4 + '@types/node': 20.11.10 + dev: true + + /@types/sinon-chai@3.2.12: + resolution: {integrity: sha512-9y0Gflk3b0+NhQZ/oxGtaAJDvRywCa5sIyaVnounqLvmf93yBF4EgIRspePtkMs3Tr844nCclYMlcCNmLCvjuQ==} + dependencies: + '@types/chai': 4.3.11 + '@types/sinon': 17.0.3 + dev: true + + /@types/sinon@17.0.3: + resolution: {integrity: sha512-j3uovdn8ewky9kRBG19bOwaZbexJu/XjtkHyjvUgt4xfPFz18dcORIMqnYh66Fx3Powhcr85NT5+er3+oViapw==} + dependencies: + '@types/sinonjs__fake-timers': 8.1.5 + dev: true + + /@types/sinonjs__fake-timers@8.1.5: + resolution: {integrity: sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==} + dev: true + + /@types/symbol-tree@3.2.5: + resolution: {integrity: sha512-zXnnyENt1TYQcS21MkPaJCVjfcPq7p7yc5mo5JACuumXp6sly5jnlS0IokHd+xmmuCbx6V7JqkMBpswR+nZAcw==} + dev: true + + /@types/through2@2.0.41: + resolution: {integrity: sha512-ryQ0tidWkb1O1JuYvWKyMLYEtOWDqF5mHerJzKz/gQpoAaJq2l/dsMPBF0B5BNVT34rbARYJ5/tsZwLfUi2kwQ==} + dependencies: + '@types/node': 20.11.10 + dev: true + + /@types/trusted-types@2.0.7: + resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} + dev: true + + /@types/uglify-js@3.17.4: + resolution: {integrity: sha512-Hm/T0kV3ywpJyMGNbsItdivRhYNCQQf1IIsYsXnoVPES4t+FMLyDe0/K+Ea7ahWtMtSNb22ZdY7MIyoD9rqARg==} + dependencies: + source-map: 0.6.1 + dev: true + + /@types/uuid@9.0.8: + resolution: {integrity: sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==} + dev: true + + /@types/which@2.0.2: + resolution: {integrity: sha512-113D3mDkZDjo+EeUEHCFy0qniNc1ZpecGiAU7WSo7YDoSzolZIQKpYFHrPpjkB2nuyahcKfrmLXeQlh7gqJYdw==} + dev: true + + /@types/which@3.0.3: + resolution: {integrity: sha512-2C1+XoY0huExTbs8MQv1DuS5FS86+SEjdM9F/+GS61gg5Hqbtj8ZiDSx8MfWcyei907fIPbfPGCOrNUTnVHY1g==} + dev: true + + /@types/ws@7.4.7: + resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} + dependencies: + '@types/node': 20.11.10 + dev: true + + /@types/ws@8.5.10: + resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} + dependencies: + '@types/node': 20.11.10 + dev: true + + /@types/yauzl@2.10.3: + resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} + requiresBuild: true + dependencies: + '@types/node': 20.11.10 + dev: true + optional: true + + /@web/browser-logs@0.2.6: + resolution: {integrity: sha512-CNjNVhd4FplRY8PPWIAt02vAowJAVcOoTNrR/NNb/o9pka7yI9qdjpWrWhEbPr2pOXonWb52AeAgdK66B8ZH7w==} + engines: {node: '>=10.0.0'} + dependencies: + errorstacks: 2.4.1 + dev: true + + /@web/dev-server-core@0.4.1: + resolution: {integrity: sha512-KdYwejXZwIZvb6tYMCqU7yBiEOPfKLQ3V9ezqqEz8DA9V9R3oQWaowckvCpFB9IxxPfS/P8/59OkdzGKQjcIUw==} + engines: {node: '>=10.0.0'} + dependencies: + '@types/koa': 2.14.0 + '@types/ws': 7.4.7 + '@web/parse5-utils': 1.3.1 + chokidar: 3.5.3 + clone: 2.1.2 + es-module-lexer: 1.4.1 + get-stream: 6.0.1 + is-stream: 2.0.1 + isbinaryfile: 5.0.0 + koa: 2.15.0 + koa-etag: 4.0.0 + koa-send: 5.0.1 + koa-static: 5.0.0 + lru-cache: 6.0.0 + mime-types: 2.1.35 + parse5: 6.0.1 + picomatch: 2.3.1 + ws: 7.5.9 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@web/parse5-utils@1.3.1: + resolution: {integrity: sha512-haCgDchZrAOB9EhBJ5XqiIjBMsS/exsM5Ru7sCSyNkXVEJWskyyKuKMFk66BonnIGMPpDtqDrTUfYEis5Zi3XA==} + engines: {node: '>=10.0.0'} + dependencies: + '@types/parse5': 6.0.3 + parse5: 6.0.1 + dev: true + + /@web/test-runner-commands@0.6.6: + resolution: {integrity: sha512-2DcK/+7f8QTicQpGFq/TmvKHDK/6Zald6rn1zqRlmj3pcH8fX6KHNVMU60Za9QgAKdorMBPfd8dJwWba5otzdw==} + engines: {node: '>=12.0.0'} + dependencies: + '@web/test-runner-core': 0.10.29 + mkdirp: 1.0.4 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@web/test-runner-core@0.10.29: + resolution: {integrity: sha512-0/ZALYaycEWswHhpyvl5yqo0uIfCmZe8q14nGPi1dMmNiqLcHjyFGnuIiLexI224AW74ljHcHllmDlXK9FUKGA==} + engines: {node: '>=12.0.0'} + dependencies: + '@babel/code-frame': 7.23.5 + '@types/babel__code-frame': 7.0.6 + '@types/co-body': 6.1.3 + '@types/convert-source-map': 2.0.3 + '@types/debounce': 1.2.4 + '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-reports': 3.0.4 + '@web/browser-logs': 0.2.6 + '@web/dev-server-core': 0.4.1 + chokidar: 3.5.3 + cli-cursor: 3.1.0 + co-body: 6.1.0 + convert-source-map: 2.0.0 + debounce: 1.2.1 + dependency-graph: 0.11.0 + globby: 11.1.0 + ip: 1.1.8 + istanbul-lib-coverage: 3.2.2 + istanbul-lib-report: 3.0.1 + istanbul-reports: 3.1.6 + log-update: 4.0.0 + nanocolors: 0.2.13 + nanoid: 3.3.7 + open: 8.4.2 + picomatch: 2.3.1 + source-map: 0.7.4 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /accepts@1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + dev: true + + /acorn-walk@8.3.2: + resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} + engines: {node: '>=0.4.0'} + dev: true + + /acorn@8.11.3: + resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + /agent-base@6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /agentkeepalive@4.5.0: + resolution: {integrity: sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==} + engines: {node: '>= 8.0.0'} + dependencies: + humanize-ms: 1.2.1 + dev: true + + /aggregate-error@4.0.1: + resolution: {integrity: sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==} + engines: {node: '>=12'} + dependencies: + clean-stack: 4.2.0 + indent-string: 5.0.0 + dev: true + + /ansi-256-colors@1.1.0: + resolution: {integrity: sha1-kQ3lDvzHwJ49gvL4er1rcAwYgYo=} + engines: {node: '>=0.10.0'} + dev: true + + /ansi-colors@3.2.3: + resolution: {integrity: sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==} + engines: {node: '>=6'} + dev: true + + /ansi-escapes@4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.21.3 + dev: true + + /ansi-regex@3.0.1: + resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==} + engines: {node: '>=4'} + dev: true + + /ansi-regex@4.1.1: + resolution: {integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==} + engines: {node: '>=6'} + dev: true + + /ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + + /ansi-regex@6.0.1: + resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} + engines: {node: '>=12'} + dev: true + + /ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + dependencies: + color-convert: 1.9.3 + dev: true + + /ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /ansi-styles@6.2.1: + resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} + engines: {node: '>=12'} + dev: true + + /anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + dev: true + + /arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + dev: true + + /argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + dependencies: + sprintf-js: 1.0.3 + dev: true + + /argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + dev: true + + /array-buffer-byte-length@1.0.0: + resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} + dependencies: + call-bind: 1.0.5 + is-array-buffer: 3.0.2 + dev: true + + /array-flatten@1.1.1: + resolution: {integrity: sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=} + dev: true + + /array-union@2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + dev: true + + /array.prototype.reduce@1.0.6: + resolution: {integrity: sha512-UW+Mz8LG/sPSU8jRDCjVr6J/ZKAGpHfwrZ6kWTG5qCxIEiXdVshqGnu5vEZA8S1y6X4aCSbQZ0/EEsfvEvBiSg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + es-array-method-boxes-properly: 1.0.0 + is-string: 1.0.7 + dev: true + + /arraybuffer.prototype.slice@1.0.2: + resolution: {integrity: sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.0 + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + get-intrinsic: 1.2.2 + is-array-buffer: 3.0.2 + is-shared-array-buffer: 1.0.2 + dev: true + + /assertion-error@1.1.0: + resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + dev: true + + /astral-regex@2.0.0: + resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} + engines: {node: '>=8'} + dev: true + + /asynckit@0.4.0: + resolution: {integrity: sha1-x57Zf380y48robyXkLzDZkdLS3k=} + dev: true + + /available-typed-arrays@1.0.5: + resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} + engines: {node: '>= 0.4'} + dev: true + + /axe-core@4.8.3: + resolution: {integrity: sha512-d5ZQHPSPkF9Tw+yfyDcRoUOc4g/8UloJJe5J8m4L5+c7AtDdjDLRxew/knnI4CxvtdxEUVgWz4x3OIQUIFiMfw==} + engines: {node: '>=4'} + dev: true + + /balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true + + /base64-arraybuffer-es6@0.7.0: + resolution: {integrity: sha512-ESyU/U1CFZDJUdr+neHRhNozeCv72Y7Vm0m1DCbjX3KBjT6eYocvAJlSk6+8+HkVwXlT1FNxhGW6q3UKAlCvvw==} + engines: {node: '>=6.0.0'} + dev: true + + /base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + dev: true + + /base64id@2.0.0: + resolution: {integrity: sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==} + engines: {node: ^4.5.0 || >= 5.9} + dev: true + + /binary-extensions@2.2.0: + resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} + engines: {node: '>=8'} + dev: true + + /bl@4.1.0: + resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + dependencies: + buffer: 5.7.1 + inherits: 2.0.4 + readable-stream: 3.6.2 + dev: true + + /body-parser@1.20.1: + resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.1 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /body-parser@1.20.2: + resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.2 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: true + + /braces@3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: true + + /browser-stdout@1.3.1: + resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} + dev: true + + /buffer-crc32@0.2.13: + resolution: {integrity: sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=} + dev: true + + /buffer-json@2.0.0: + resolution: {integrity: sha512-+jjPFVqyfF1esi9fvfUs3NqM0pH1ziZ36VP4hmA/y/Ssfo/5w5xHKfTw9BwQjoJ1w/oVtpLomqwUHKdefGyuHw==} + dev: true + + /buffer@5.7.1: + resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: true + + /buffer@6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: true + + /bytes@3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + dev: true + + /cache-content-type@1.0.1: + resolution: {integrity: sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==} + engines: {node: '>= 6.0.0'} + dependencies: + mime-types: 2.1.35 + ylru: 1.3.2 + dev: true + + /cacheable-lookup@7.0.0: + resolution: {integrity: sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==} + engines: {node: '>=14.16'} + dev: true + + /cacheable-request@10.2.14: + resolution: {integrity: sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==} + engines: {node: '>=14.16'} + dependencies: + '@types/http-cache-semantics': 4.0.4 + get-stream: 6.0.1 + http-cache-semantics: 4.1.1 + keyv: 4.5.4 + mimic-response: 4.0.0 + normalize-url: 8.0.0 + responselike: 3.0.0 + dev: true + + /call-bind@1.0.5: + resolution: {integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==} + dependencies: + function-bind: 1.1.2 + get-intrinsic: 1.2.2 + set-function-length: 1.2.0 + dev: true + + /callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + dev: true + + /camel-case@3.0.0: + resolution: {integrity: sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=} + dependencies: + no-case: 2.3.2 + upper-case: 1.1.3 + dev: true + + /camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + dev: true + + /chai-a11y-axe@1.5.0: + resolution: {integrity: sha512-V/Vg/zJDr9aIkaHJ2KQu7lGTQQm5ZOH4u1k5iTMvIXuSVlSuUo0jcSpSqf9wUn9zl6oQXa4e4E0cqH18KOgKlQ==} + dependencies: + axe-core: 4.8.3 + dev: true + + /chai-dom@1.12.0(chai@4.4.1): + resolution: {integrity: sha512-pLP8h6IBR8z1AdeQ+EMcJ7dXPdsax/1Q7gdGZjsnAmSBl3/gItQUYSCo32br1qOy4SlcBjvqId7ilAf3uJ2K1w==} + engines: {node: '>= 0.12.0'} + peerDependencies: + chai: '>= 3' + dependencies: + chai: 4.4.1 + dev: true + + /chai@4.4.1: + resolution: {integrity: sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==} + engines: {node: '>=4'} + dependencies: + assertion-error: 1.1.0 + check-error: 1.0.3 + deep-eql: 4.1.3 + get-func-name: 2.0.2 + loupe: 2.3.7 + pathval: 1.1.1 + type-detect: 4.0.8 + dev: true + + /chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + dev: true + + /check-error@1.0.3: + resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + dependencies: + get-func-name: 2.0.2 + dev: true + + /chokidar@3.5.3: + resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} + engines: {node: '>= 8.10.0'} + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + dev: true + + /chownr@1.1.4: + resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} + dev: true + + /clean-css@4.2.4: + resolution: {integrity: sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==} + engines: {node: '>= 4.0'} + dependencies: + source-map: 0.6.1 + dev: true + + /clean-stack@1.3.0: + resolution: {integrity: sha1-noIVAa6XmYbEax1m0tQy2y/UrjE=} + engines: {node: '>=4'} + dev: true + + /clean-stack@4.2.0: + resolution: {integrity: sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==} + engines: {node: '>=12'} + dependencies: + escape-string-regexp: 5.0.0 + dev: true + + /cli-cursor@3.1.0: + resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} + engines: {node: '>=8'} + dependencies: + restore-cursor: 3.1.0 + dev: true + + /cliui@5.0.0: + resolution: {integrity: sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==} + dependencies: + string-width: 3.1.0 + strip-ansi: 5.2.0 + wrap-ansi: 5.1.0 + dev: true + + /clone@2.1.2: + resolution: {integrity: sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=} + engines: {node: '>=0.8'} + dev: true + + /co-body@6.1.0: + resolution: {integrity: sha512-m7pOT6CdLN7FuXUcpuz/8lfQ/L77x8SchHCF4G0RBTJO20Wzmhn5Sp4/5WsKy8OSpifBSUrmg83qEqaDHdyFuQ==} + dependencies: + inflation: 2.1.0 + qs: 6.11.2 + raw-body: 2.5.2 + type-is: 1.6.18 + dev: true + + /co@4.6.0: + resolution: {integrity: sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=} + engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + dev: true + + /color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + dependencies: + color-name: 1.1.3 + dev: true + + /color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name@1.1.3: + resolution: {integrity: sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=} + dev: true + + /color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + dependencies: + delayed-stream: 1.0.0 + dev: true + + /commander@2.20.3: + resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + dev: true + + /concat-map@0.0.1: + resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + dev: true + + /content-disposition@0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /content-type@1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + dev: true + + /convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + dev: true + + /cookie-signature@1.0.6: + resolution: {integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw=} + dev: true + + /cookie@0.4.2: + resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} + engines: {node: '>= 0.6'} + dev: true + + /cookie@0.5.0: + resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} + engines: {node: '>= 0.6'} + dev: true + + /cookies@0.9.1: + resolution: {integrity: sha512-TG2hpqe4ELx54QER/S3HQ9SRVnQnGBtKUz5bLQWtYAQ+o6GpgMs6sYUvaiJjVxb+UXwhRhAEP3m7LbsIZ77Hmw==} + engines: {node: '>= 0.8'} + dependencies: + depd: 2.0.0 + keygrip: 1.1.0 + dev: true + + /core-util-is@1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + dev: true + + /cors@2.8.5: + resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} + engines: {node: '>= 0.10'} + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + dev: true + + /create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + dev: true + + /croner@4.4.1: + resolution: {integrity: sha512-aqVeeIPCf5/NZFlz4mN4MLEOs9xf4ODCmHQDs+577JFj8mK3RkKJz77h7+Rn94AijUqKdFNOUHM+v88d8p02UQ==} + dev: true + + /croner@5.7.0: + resolution: {integrity: sha512-9pSLe+tDJnmNak2JeMkz6ZmTCXP5p6vCxSd4kvDqrTJkqAP62j2uAEIZjf8cPDZIakStujqVzh5Y5MIWH3yYAw==} + engines: {node: '>=6.0'} + dev: true + + /croner@7.0.5: + resolution: {integrity: sha512-15HLCD7iXnMe5km54yc4LN5BH+Cg9uCQvbkJ0acHxFffE29w3Uvgb9s/l310UCVUgMwGSBNw9BAHsEb5uMgj1g==} + engines: {node: '>=6.0'} + dev: true + + /cross-fetch@3.1.5: + resolution: {integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==} + dependencies: + node-fetch: 2.6.7 + transitivePeerDependencies: + - encoding + dev: true + + /cross-spawn@7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + + /crypto-random-string@5.0.0: + resolution: {integrity: sha512-KWjTXWwxFd6a94m5CdRGW/t82Tr8DoBc9dNnPCAbFI1EBweN6v1tv8y4Y1m7ndkp/nkIBRxUxAzpaBnR2k3bcQ==} + engines: {node: '>=14.16'} + dependencies: + type-fest: 2.19.0 + dev: true + + /dayjs@1.11.10: + resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} + dev: true + + /debounce@1.2.1: + resolution: {integrity: sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==} + dev: true + + /debug@2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: true + + /debug@3.2.6(supports-color@6.0.0): + resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} + deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.1 + supports-color: 6.0.0 + dev: true + + /debug@3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.3 + dev: true + + /debug@4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + + /decamelize@1.2.0: + resolution: {integrity: sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=} + engines: {node: '>=0.10.0'} + dev: true + + /decompress-response@6.0.0: + resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} + engines: {node: '>=10'} + dependencies: + mimic-response: 3.1.0 + dev: true + + /deep-eql@4.1.3: + resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} + engines: {node: '>=6'} + dependencies: + type-detect: 4.0.8 + dev: true + + /deep-equal@1.0.1: + resolution: {integrity: sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=} + dev: true + + /defer-to-connect@2.0.1: + resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} + engines: {node: '>=10'} + dev: true + + /define-data-property@1.1.1: + resolution: {integrity: sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.2 + gopd: 1.0.1 + has-property-descriptors: 1.0.1 + dev: true + + /define-lazy-prop@2.0.0: + resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==} + engines: {node: '>=8'} + dev: true + + /define-properties@1.2.1: + resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.1 + has-property-descriptors: 1.0.1 + object-keys: 1.1.1 + dev: true + + /delayed-stream@1.0.0: + resolution: {integrity: sha1-3zrhmayt+31ECqrgsp4icrJOxhk=} + engines: {node: '>=0.4.0'} + dev: true + + /delegates@1.0.0: + resolution: {integrity: sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=} + dev: true + + /depd@1.1.2: + resolution: {integrity: sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=} + engines: {node: '>= 0.6'} + dev: true + + /depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + dev: true + + /dependency-graph@0.11.0: + resolution: {integrity: sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg==} + engines: {node: '>= 0.6.0'} + dev: true + + /destroy@1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dev: true + + /devtools-protocol@0.0.1019158: + resolution: {integrity: sha512-wvq+KscQ7/6spEV7czhnZc9RM/woz1AY+/Vpd8/h2HFMwJSdTliu7f/yr1A6vDdJfKICZsShqsYpEQbdhg8AFQ==} + dev: true + + /diff@3.5.0: + resolution: {integrity: sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==} + engines: {node: '>=0.3.1'} + dev: true + + /diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + dev: true + + /diff@5.1.0: + resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} + engines: {node: '>=0.3.1'} + dev: true + + /dir-glob@3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + dependencies: + path-type: 4.0.0 + dev: true + + /dns-packet@5.6.1: + resolution: {integrity: sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==} + engines: {node: '>=6'} + dependencies: + '@leichtgewicht/ip-codec': 2.0.4 + dev: true + + /dns-socket@4.2.2: + resolution: {integrity: sha512-BDeBd8najI4/lS00HSKpdFia+OvUMytaVjfzR9n5Lq8MlZRSvtbI+uLtx1+XmQFls5wFU9dssccTmQQ6nfpjdg==} + engines: {node: '>=6'} + dependencies: + dns-packet: 5.6.1 + dev: true + + /domexception@1.0.1: + resolution: {integrity: sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==} + dependencies: + webidl-conversions: 4.0.2 + dev: true + + /eastasianwidth@0.2.0: + resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + dev: true + + /ee-first@1.1.1: + resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=} + dev: true + + /emoji-regex@7.0.3: + resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} + dev: true + + /emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true + + /emoji-regex@9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + dev: true + + /encodeurl@1.0.2: + resolution: {integrity: sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=} + engines: {node: '>= 0.8'} + dev: true + + /end-of-stream@1.4.4: + resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + dependencies: + once: 1.4.0 + dev: true + + /engine.io-client@6.5.3: + resolution: {integrity: sha512-9Z0qLB0NIisTRt1DZ/8U2k12RJn8yls/nXMZLn+/N8hANT3TcYjKFKcwbw5zFQiN4NTde3TSY9zb79e1ij6j9Q==} + dependencies: + '@socket.io/component-emitter': 3.1.0 + debug: 4.3.4 + engine.io-parser: 5.2.1 + ws: 8.11.0 + xmlhttprequest-ssl: 2.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /engine.io-parser@5.2.1: + resolution: {integrity: sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ==} + engines: {node: '>=10.0.0'} + dev: true + + /engine.io@6.5.2: + resolution: {integrity: sha512-IXsMcGpw/xRfjra46sVZVHiSWo/nJ/3g1337q9KNXtS6YRzbW5yIzTCb9DjhrBe7r3GZQR0I4+nq+4ODk5g/cA==} + engines: {node: '>=10.2.0'} + dependencies: + '@types/cookie': 0.4.1 + '@types/cors': 2.8.17 + '@types/node': 20.11.10 + accepts: 1.3.8 + base64id: 2.0.0 + cookie: 0.4.2 + cors: 2.8.5 + debug: 4.3.4 + engine.io-parser: 5.2.1 + ws: 8.11.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /entities@2.2.0: + resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} + dev: true + + /errorstacks@2.4.1: + resolution: {integrity: sha512-jE4i0SMYevwu/xxAuzhly/KTwtj0xDhbzB6m1xPImxTkw8wcCbgarOQPfCVMi5JKVyW7in29pNJCCJrry3Ynnw==} + dev: true + + /es-abstract@1.22.3: + resolution: {integrity: sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.0 + arraybuffer.prototype.slice: 1.0.2 + available-typed-arrays: 1.0.5 + call-bind: 1.0.5 + es-set-tostringtag: 2.0.2 + es-to-primitive: 1.2.1 + function.prototype.name: 1.1.6 + get-intrinsic: 1.2.2 + get-symbol-description: 1.0.0 + globalthis: 1.0.3 + gopd: 1.0.1 + has-property-descriptors: 1.0.1 + has-proto: 1.0.1 + has-symbols: 1.0.3 + hasown: 2.0.0 + internal-slot: 1.0.6 + is-array-buffer: 3.0.2 + is-callable: 1.2.7 + is-negative-zero: 2.0.2 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + is-string: 1.0.7 + is-typed-array: 1.1.12 + is-weakref: 1.0.2 + object-inspect: 1.13.1 + object-keys: 1.1.1 + object.assign: 4.1.5 + regexp.prototype.flags: 1.5.1 + safe-array-concat: 1.1.0 + safe-regex-test: 1.0.2 + string.prototype.trim: 1.2.8 + string.prototype.trimend: 1.0.7 + string.prototype.trimstart: 1.0.7 + typed-array-buffer: 1.0.0 + typed-array-byte-length: 1.0.0 + typed-array-byte-offset: 1.0.0 + typed-array-length: 1.0.4 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.13 + dev: true + + /es-array-method-boxes-properly@1.0.0: + resolution: {integrity: sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==} + dev: true + + /es-module-lexer@1.4.1: + resolution: {integrity: sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==} + dev: true + + /es-set-tostringtag@2.0.2: + resolution: {integrity: sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.2 + has-tostringtag: 1.0.0 + hasown: 2.0.0 + dev: true + + /es-to-primitive@1.2.1: + resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + engines: {node: '>= 0.4'} + dependencies: + is-callable: 1.2.7 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + dev: true + + /esbuild@0.19.12: + resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/aix-ppc64': 0.19.12 + '@esbuild/android-arm': 0.19.12 + '@esbuild/android-arm64': 0.19.12 + '@esbuild/android-x64': 0.19.12 + '@esbuild/darwin-arm64': 0.19.12 + '@esbuild/darwin-x64': 0.19.12 + '@esbuild/freebsd-arm64': 0.19.12 + '@esbuild/freebsd-x64': 0.19.12 + '@esbuild/linux-arm': 0.19.12 + '@esbuild/linux-arm64': 0.19.12 + '@esbuild/linux-ia32': 0.19.12 + '@esbuild/linux-loong64': 0.19.12 + '@esbuild/linux-mips64el': 0.19.12 + '@esbuild/linux-ppc64': 0.19.12 + '@esbuild/linux-riscv64': 0.19.12 + '@esbuild/linux-s390x': 0.19.12 + '@esbuild/linux-x64': 0.19.12 + '@esbuild/netbsd-x64': 0.19.12 + '@esbuild/openbsd-x64': 0.19.12 + '@esbuild/sunos-x64': 0.19.12 + '@esbuild/win32-arm64': 0.19.12 + '@esbuild/win32-ia32': 0.19.12 + '@esbuild/win32-x64': 0.19.12 + dev: true + + /escape-html@1.0.3: + resolution: {integrity: sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=} + dev: true + + /escape-string-regexp@1.0.5: + resolution: {integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=} + engines: {node: '>=0.8.0'} + dev: true + + /escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + dev: true + + /escape-string-regexp@5.0.0: + resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} + engines: {node: '>=12'} + dev: true + + /esm@3.2.25: + resolution: {integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==} + engines: {node: '>=6'} + dev: true + + /esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /etag@1.8.1: + resolution: {integrity: sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=} + engines: {node: '>= 0.6'} + dev: true + + /express-force-ssl@0.3.2: + resolution: {integrity: sha1-AbK0mK5v0uQRUrIrV6Phc3c69n4=} + engines: {node: '>=0.2.2'} + dependencies: + lodash.assign: 3.2.0 + dev: true + + /express@4.18.2: + resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} + engines: {node: '>= 0.10.0'} + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.1 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.5.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.2.0 + fresh: 0.5.2 + http-errors: 2.0.0 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.7 + qs: 6.11.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.18.0 + serve-static: 1.15.0 + setprototypeof: 1.2.0 + statuses: 2.0.1 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /extract-zip@2.0.1: + resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==} + engines: {node: '>= 10.17.0'} + hasBin: true + dependencies: + debug: 4.3.4 + get-stream: 5.2.0 + yauzl: 2.10.0 + optionalDependencies: + '@types/yauzl': 2.10.3 + transitivePeerDependencies: + - supports-color + dev: true + + /fake-indexeddb@4.0.2: + resolution: {integrity: sha512-SdTwEhnakbgazc7W3WUXOJfGmhH0YfG4d+dRPOFoYDRTL6U5t8tvrmkf2W/C3W1jk2ylV7Wrnj44RASqpX/lEw==} + dependencies: + realistic-structured-clone: 3.0.0 + dev: true + + /fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + dev: true + + /fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: true + + /fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: true + + /fast-xml-parser@4.3.3: + resolution: {integrity: sha512-coV/D1MhrShMvU6D0I+VAK3umz6hUaxxhL0yp/9RjfiYUfAv14rDhGQL+PLForhMdr0wq3PiV07WtkkNjJjNHg==} + hasBin: true + dependencies: + strnum: 1.0.5 + dev: true + + /fastq@1.17.0: + resolution: {integrity: sha512-zGygtijUMT7jnk3h26kUms3BkSDp4IfIKjmnqI2tvx6nuBfiF1UqOxbnLfzdv+apBy+53oaImsKtMw/xYbW+1w==} + dependencies: + reusify: 1.0.4 + dev: true + + /fd-slicer@1.1.0: + resolution: {integrity: sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=} + dependencies: + pend: 1.2.0 + dev: true + + /feed@4.2.2: + resolution: {integrity: sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ==} + engines: {node: '>=0.4.0'} + dependencies: + xml-js: 1.6.11 + dev: true + + /figures@6.0.1: + resolution: {integrity: sha512-0oY/olScYD4IhQ8u//gCPA4F3mlTn2dacYmiDm/mbDQvpmLjV4uH+zhsQ5IyXRyvqkvtUkXkNdGvg5OFJTCsuQ==} + engines: {node: '>=18'} + dependencies: + is-unicode-supported: 2.0.0 + dev: true + + /fill-range@7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + + /finalhandler@1.2.0: + resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} + engines: {node: '>= 0.8'} + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.1 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /find-up@3.0.0: + resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} + engines: {node: '>=6'} + dependencies: + locate-path: 3.0.0 + dev: true + + /find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + dev: true + + /flat@4.1.1: + resolution: {integrity: sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==} + hasBin: true + dependencies: + is-buffer: 2.0.5 + dev: true + + /for-each@0.3.3: + resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + dependencies: + is-callable: 1.2.7 + dev: true + + /foreground-child@2.0.0: + resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==} + engines: {node: '>=8.0.0'} + dependencies: + cross-spawn: 7.0.3 + signal-exit: 3.0.7 + dev: true + + /foreground-child@3.1.1: + resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} + engines: {node: '>=14'} + dependencies: + cross-spawn: 7.0.3 + signal-exit: 4.1.0 + dev: true + + /form-data-encoder@2.1.4: + resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} + engines: {node: '>= 14.17'} + dev: true + + /form-data@4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: true + + /forwarded@0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + dev: true + + /fresh@0.5.2: + resolution: {integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=} + engines: {node: '>= 0.6'} + dev: true + + /from2@2.3.0: + resolution: {integrity: sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=} + dependencies: + inherits: 2.0.4 + readable-stream: 2.3.8 + dev: true + + /fs-constants@1.0.0: + resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + dev: true + + /fs-extra@11.2.0: + resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} + engines: {node: '>=14.14'} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.1 + dev: true + + /fs.realpath@1.0.0: + resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=} + dev: true + + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + dev: true + + /function.prototype.name@1.1.6: + resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + functions-have-names: 1.2.3 + dev: true + + /functions-have-names@1.2.3: + resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + dev: true + + /get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true + + /get-func-name@2.0.2: + resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} + dev: true + + /get-intrinsic@1.2.2: + resolution: {integrity: sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==} + dependencies: + function-bind: 1.1.2 + has-proto: 1.0.1 + has-symbols: 1.0.3 + hasown: 2.0.0 + dev: true + + /get-stream@5.2.0: + resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} + engines: {node: '>=8'} + dependencies: + pump: 3.0.0 + dev: true + + /get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + dev: true + + /get-symbol-description@1.0.0: + resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + dev: true + + /glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + dev: true + + /glob@10.3.10: + resolution: {integrity: sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==} + engines: {node: '>=16 || 14 >=14.17'} + hasBin: true + dependencies: + foreground-child: 3.1.1 + jackspeak: 2.3.6 + minimatch: 9.0.3 + minipass: 7.0.4 + path-scurry: 1.10.1 + dev: true + + /glob@7.1.3: + resolution: {integrity: sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.0.4 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /globalthis@1.0.3: + resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} + engines: {node: '>= 0.4'} + dependencies: + define-properties: 1.2.1 + dev: true + + /globby@11.1.0: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.2 + ignore: 5.3.0 + merge2: 1.4.1 + slash: 3.0.0 + dev: true + + /gopd@1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.2.2 + dev: true + + /got@12.6.1: + resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} + engines: {node: '>=14.16'} + dependencies: + '@sindresorhus/is': 5.6.0 + '@szmarczak/http-timer': 5.0.1 + cacheable-lookup: 7.0.0 + cacheable-request: 10.2.14 + decompress-response: 6.0.0 + form-data-encoder: 2.1.4 + get-stream: 6.0.1 + http2-wrapper: 2.2.1 + lowercase-keys: 3.0.0 + p-cancelable: 3.0.0 + responselike: 3.0.0 + dev: true + + /graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + dev: true + + /growl@1.10.5: + resolution: {integrity: sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==} + engines: {node: '>=4.x'} + dev: true + + /has-bigints@1.0.2: + resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} + dev: true + + /has-flag@3.0.0: + resolution: {integrity: sha1-tdRU3CGZriJWmfNGfloH87lVuv0=} + engines: {node: '>=4'} + dev: true + + /has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /has-property-descriptors@1.0.1: + resolution: {integrity: sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==} + dependencies: + get-intrinsic: 1.2.2 + dev: true + + /has-proto@1.0.1: + resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} + engines: {node: '>= 0.4'} + dev: true + + /has-symbols@1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: true + + /has-tostringtag@1.0.0: + resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + + /hasown@2.0.0: + resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} + engines: {node: '>= 0.4'} + dependencies: + function-bind: 1.1.2 + dev: true + + /he@1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + dev: true + + /html-escaper@2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + dev: true + + /html-minifier@4.0.0: + resolution: {integrity: sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig==} + engines: {node: '>=6'} + hasBin: true + dependencies: + camel-case: 3.0.0 + clean-css: 4.2.4 + commander: 2.20.3 + he: 1.2.0 + param-case: 2.1.1 + relateurl: 0.2.7 + uglify-js: 3.17.4 + dev: true + + /http-assert@1.5.0: + resolution: {integrity: sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==} + engines: {node: '>= 0.8'} + dependencies: + deep-equal: 1.0.1 + http-errors: 1.8.1 + dev: true + + /http-cache-semantics@4.1.1: + resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} + dev: true + + /http-errors@1.6.3: + resolution: {integrity: sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=} + engines: {node: '>= 0.6'} + dependencies: + depd: 1.1.2 + inherits: 2.0.3 + setprototypeof: 1.1.0 + statuses: 1.5.0 + dev: true + + /http-errors@1.8.1: + resolution: {integrity: sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==} + engines: {node: '>= 0.6'} + dependencies: + depd: 1.1.2 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 1.5.0 + toidentifier: 1.0.1 + dev: true + + /http-errors@2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + dev: true + + /http2-wrapper@2.2.1: + resolution: {integrity: sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==} + engines: {node: '>=10.19.0'} + dependencies: + quick-lru: 5.1.1 + resolve-alpn: 1.2.1 + dev: true + + /https-proxy-agent@5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /humanize-ms@1.2.1: + resolution: {integrity: sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=} + dependencies: + ms: 2.1.3 + dev: true + + /iconv-lite@0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: true + + /idb@7.1.1: + resolution: {integrity: sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==} + dev: true + + /ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + dev: true + + /ignore@5.3.0: + resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} + engines: {node: '>= 4'} + dev: true + + /indent-string@5.0.0: + resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} + engines: {node: '>=12'} + dev: true + + /inflation@2.1.0: + resolution: {integrity: sha512-t54PPJHG1Pp7VQvxyVCJ9mBbjG3Hqryges9bXoOO6GExCPa+//i/d5GSuFtpx3ALLd7lgIAur6zrIlBQyJuMlQ==} + engines: {node: '>= 0.8.0'} + dev: true + + /inflight@1.0.6: + resolution: {integrity: sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + + /inherits@2.0.3: + resolution: {integrity: sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=} + dev: true + + /inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: true + + /internal-slot@1.0.6: + resolution: {integrity: sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.2 + hasown: 2.0.0 + side-channel: 1.0.4 + dev: true + + /ip-regex@5.0.0: + resolution: {integrity: sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + + /ip@1.1.8: + resolution: {integrity: sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==} + dev: true + + /ipaddr.js@1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + dev: true + + /is-array-buffer@3.0.2: + resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + is-typed-array: 1.1.12 + dev: true + + /is-bigint@1.0.4: + resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + dependencies: + has-bigints: 1.0.2 + dev: true + + /is-binary-path@2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + dependencies: + binary-extensions: 2.2.0 + dev: true + + /is-boolean-object@1.1.2: + resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + has-tostringtag: 1.0.0 + dev: true + + /is-buffer@2.0.5: + resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} + engines: {node: '>=4'} + dev: true + + /is-callable@1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + dev: true + + /is-date-object@1.0.5: + resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-docker@2.2.1: + resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} + engines: {node: '>=8'} + hasBin: true + dev: true + + /is-extglob@2.1.1: + resolution: {integrity: sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=} + engines: {node: '>=0.10.0'} + dev: true + + /is-fullwidth-code-point@2.0.0: + resolution: {integrity: sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=} + engines: {node: '>=4'} + dev: true + + /is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: true + + /is-generator-function@1.0.10: + resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + dev: true + + /is-ip@4.0.0: + resolution: {integrity: sha512-4B4XA2HEIm/PY+OSpeMBXr8pGWBYbXuHgjMAqrwbLO3CPTCAd9ArEJzBUKGZtk9viY6+aSfadGnWyjY3ydYZkw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + ip-regex: 5.0.0 + dev: true + + /is-nan@1.3.2: + resolution: {integrity: sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + dev: true + + /is-negative-zero@2.0.2: + resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} + engines: {node: '>= 0.4'} + dev: true + + /is-number-object@1.0.7: + resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-number@4.0.0: + resolution: {integrity: sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==} + engines: {node: '>=0.10.0'} + dev: true + + /is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: true + + /is-observable@2.1.0: + resolution: {integrity: sha512-DailKdLb0WU+xX8K5w7VsJhapwHLZ9jjmazqCJq4X12CTgqq73TKnbRcnSLuXYPOoLQgV5IrD7ePiX/h1vnkBw==} + engines: {node: '>=8'} + dev: true + + /is-regex@1.1.4: + resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + has-tostringtag: 1.0.0 + dev: true + + /is-shared-array-buffer@1.0.2: + resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} + dependencies: + call-bind: 1.0.5 + dev: true + + /is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + dev: true + + /is-string@1.0.7: + resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-symbol@1.0.4: + resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + + /is-typed-array@1.1.12: + resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} + engines: {node: '>= 0.4'} + dependencies: + which-typed-array: 1.1.13 + dev: true + + /is-unicode-supported@2.0.0: + resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} + engines: {node: '>=18'} + dev: true + + /is-weakref@1.0.2: + resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + dependencies: + call-bind: 1.0.5 + dev: true + + /is-windows@1.0.2: + resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} + engines: {node: '>=0.10.0'} + dev: true + + /is-wsl@2.2.0: + resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} + engines: {node: '>=8'} + dependencies: + is-docker: 2.2.1 + dev: true + + /isarray@1.0.0: + resolution: {integrity: sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=} + dev: true + + /isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + dev: true + + /isbinaryfile@5.0.0: + resolution: {integrity: sha512-UDdnyGvMajJUWCkib7Cei/dvyJrrvo4FIrsvSFWdPpXSUorzXrDJ0S+X5Q4ZlasfPjca4yqCNNsjbCeiy8FFeg==} + engines: {node: '>= 14.0.0'} + dev: true + + /isexe@2.0.0: + resolution: {integrity: sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=} + dev: true + + /isopen@1.3.0: + resolution: {integrity: sha512-AN6Q9J0UlqHFl1fN/2xJCHCBLCBCFDjZhpGBO1gh3wzgRPsFSFBUL36I2Lbfd9qkuoj58axmE7j83iejTQsk8Q==} + dev: true + + /istanbul-lib-coverage@3.2.2: + resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} + engines: {node: '>=8'} + dev: true + + /istanbul-lib-report@3.0.1: + resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} + engines: {node: '>=10'} + dependencies: + istanbul-lib-coverage: 3.2.2 + make-dir: 4.0.0 + supports-color: 7.2.0 + dev: true + + /istanbul-reports@3.1.6: + resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} + engines: {node: '>=8'} + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.1 + dev: true + + /jackspeak@2.3.6: + resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==} + engines: {node: '>=14'} + dependencies: + '@isaacs/cliui': 8.0.2 + optionalDependencies: + '@pkgjs/parseargs': 0.11.0 + dev: true + + /js-base64@3.7.6: + resolution: {integrity: sha512-NPrWuHFxFUknr1KqJRDgUQPexQF0uIJWjeT+2KjEePhitQxQEx5EJBG1lVn5/hc8aLycTpXrDOgPQ6Zq+EDiTA==} + dev: true + + /js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + dev: true + + /js-yaml@3.13.1: + resolution: {integrity: sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==} + hasBin: true + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + dev: true + + /js-yaml@3.14.1: + resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} + hasBin: true + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + dev: true + + /js-yaml@4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + dependencies: + argparse: 2.0.1 + dev: true + + /json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + dev: true + + /jsonfile@6.1.0: + resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} + dependencies: + universalify: 2.0.1 + optionalDependencies: + graceful-fs: 4.2.11 + dev: true + + /just-extend@6.2.0: + resolution: {integrity: sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==} + dev: true + + /keygrip@1.1.0: + resolution: {integrity: sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==} + engines: {node: '>= 0.6'} + dependencies: + tsscmp: 1.0.6 + dev: true + + /keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + dependencies: + json-buffer: 3.0.1 + dev: true + + /kind-of@6.0.3: + resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} + engines: {node: '>=0.10.0'} + dev: true + + /koa-compose@4.1.0: + resolution: {integrity: sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==} + dev: true + + /koa-convert@2.0.0: + resolution: {integrity: sha512-asOvN6bFlSnxewce2e/DK3p4tltyfC4VM7ZwuTuepI7dEQVcvpyFuBcEARu1+Hxg8DIwytce2n7jrZtRlPrARA==} + engines: {node: '>= 10'} + dependencies: + co: 4.6.0 + koa-compose: 4.1.0 + dev: true + + /koa-etag@4.0.0: + resolution: {integrity: sha512-1cSdezCkBWlyuB9l6c/IFoe1ANCDdPBxkDkRiaIup40xpUub6U/wwRXoKBZw/O5BifX9OlqAjYnDyzM6+l+TAg==} + dependencies: + etag: 1.8.1 + dev: true + + /koa-send@5.0.1: + resolution: {integrity: sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ==} + engines: {node: '>= 8'} + dependencies: + debug: 4.3.4 + http-errors: 1.8.1 + resolve-path: 1.4.0 + transitivePeerDependencies: + - supports-color + dev: true + + /koa-static@5.0.0: + resolution: {integrity: sha512-UqyYyH5YEXaJrf9S8E23GoJFQZXkBVJ9zYYMPGz919MSX1KuvAcycIuS0ci150HCoPf4XQVhQ84Qf8xRPWxFaQ==} + engines: {node: '>= 7.6.0'} + dependencies: + debug: 3.2.7 + koa-send: 5.0.1 + transitivePeerDependencies: + - supports-color + dev: true + + /koa@2.15.0: + resolution: {integrity: sha512-KEL/vU1knsoUvfP4MC4/GthpQrY/p6dzwaaGI6Rt4NQuFqkw3qrvsdYF5pz3wOfi7IGTvMPHC9aZIcUKYFNxsw==} + engines: {node: ^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4} + dependencies: + accepts: 1.3.8 + cache-content-type: 1.0.1 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookies: 0.9.1 + debug: 4.3.4 + delegates: 1.0.0 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + fresh: 0.5.2 + http-assert: 1.5.0 + http-errors: 1.8.1 + is-generator-function: 1.0.10 + koa-compose: 4.1.0 + koa-convert: 2.0.0 + on-finished: 2.4.1 + only: 0.0.2 + parseurl: 1.3.3 + statuses: 1.5.0 + type-is: 1.6.18 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /lit-element@2.5.1: + resolution: {integrity: sha512-ogu7PiJTA33bEK0xGu1dmaX5vhcRjBXCFexPja0e7P7jqLhTpNKYRPmE+GmiCaRVAbiQKGkUgkh/i6+bh++dPQ==} + dependencies: + lit-html: 1.4.1 + dev: true + + /lit-element@4.0.3: + resolution: {integrity: sha512-2vhidmC7gGLfnVx41P8UZpzyS0Fb8wYhS5RCm16cMW3oERO0Khd3EsKwtRpOnttuByI5rURjT2dfoA7NlInCNw==} + dependencies: + '@lit-labs/ssr-dom-shim': 1.1.2 + '@lit/reactive-element': 2.0.3 + lit-html: 3.1.1 + dev: true + + /lit-html@1.4.1: + resolution: {integrity: sha512-B9btcSgPYb1q4oSOb/PrOT6Z/H+r6xuNzfH4lFli/AWhYwdtrgQkQWBbIc6mdnf6E2IL3gDXdkkqNktpU0OZQA==} + dev: true + + /lit-html@3.1.1: + resolution: {integrity: sha512-x/EwfGk2D/f4odSFM40hcGumzqoKv0/SUh6fBO+1Ragez81APrcAMPo1jIrCDd9Sn+Z4CT867HWKViByvkDZUA==} + dependencies: + '@types/trusted-types': 2.0.7 + dev: true + + /lit@3.1.1: + resolution: {integrity: sha512-hF1y4K58+Gqrz+aAPS0DNBwPqPrg6P04DuWK52eMkt/SM9Qe9keWLcFgRcEKOLuDlRZlDsDbNL37Vr7ew1VCuw==} + dependencies: + '@lit/reactive-element': 2.0.3 + lit-element: 4.0.3 + lit-html: 3.1.1 + dev: true + + /locate-path@3.0.0: + resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} + engines: {node: '>=6'} + dependencies: + p-locate: 3.0.0 + path-exists: 3.0.0 + dev: true + + /locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + dependencies: + p-locate: 4.1.0 + dev: true + + /lodash._baseassign@3.2.0: + resolution: {integrity: sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=} + dependencies: + lodash._basecopy: 3.0.1 + lodash.keys: 3.1.2 + dev: true + + /lodash._basecopy@3.0.1: + resolution: {integrity: sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=} + dev: true + + /lodash._bindcallback@3.0.1: + resolution: {integrity: sha1-5THCdkTPi1epnhftlbNcdIeJOS4=} + dev: true + + /lodash._createassigner@3.1.1: + resolution: {integrity: sha1-g4pbri/aymOsIt7o4Z+k5taXCxE=} + dependencies: + lodash._bindcallback: 3.0.1 + lodash._isiterateecall: 3.0.9 + lodash.restparam: 3.6.1 + dev: true + + /lodash._getnative@3.9.1: + resolution: {integrity: sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=} + dev: true + + /lodash._isiterateecall@3.0.9: + resolution: {integrity: sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=} + dev: true + + /lodash.assign@3.2.0: + resolution: {integrity: sha1-POnwI0tLIiPilrj6CsH+6OvKZPo=} + dependencies: + lodash._baseassign: 3.2.0 + lodash._createassigner: 3.1.1 + lodash.keys: 3.1.2 + dev: true + + /lodash.clonedeep@4.5.0: + resolution: {integrity: sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=} + dev: true + + /lodash.get@4.4.2: + resolution: {integrity: sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=} + dev: true + + /lodash.isarguments@3.1.0: + resolution: {integrity: sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=} + dev: true + + /lodash.isarray@3.0.4: + resolution: {integrity: sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=} + dev: true + + /lodash.keys@3.1.2: + resolution: {integrity: sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=} + dependencies: + lodash._getnative: 3.9.1 + lodash.isarguments: 3.1.0 + lodash.isarray: 3.0.4 + dev: true + + /lodash.restparam@3.6.1: + resolution: {integrity: sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=} + dev: true + + /lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: true + + /log-symbols@2.2.0: + resolution: {integrity: sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==} + engines: {node: '>=4'} + dependencies: + chalk: 2.4.2 + dev: true + + /log-update@4.0.0: + resolution: {integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==} + engines: {node: '>=10'} + dependencies: + ansi-escapes: 4.3.2 + cli-cursor: 3.1.0 + slice-ansi: 4.0.0 + wrap-ansi: 6.2.0 + dev: true + + /loupe@2.3.7: + resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} + dependencies: + get-func-name: 2.0.2 + dev: true + + /lower-case@1.1.4: + resolution: {integrity: sha1-miyr0bno4K6ZOkv31YdcOcQujqw=} + dev: true + + /lowercase-keys@3.0.0: + resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + + /lru-cache@10.2.0: + resolution: {integrity: sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==} + engines: {node: 14 || >=16.14} + dev: true + + /lru-cache@6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + dependencies: + yallist: 4.0.0 + dev: true + + /make-dir@3.1.0: + resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} + engines: {node: '>=8'} + dependencies: + semver: 6.3.1 + dev: true + + /make-dir@4.0.0: + resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} + engines: {node: '>=10'} + dependencies: + semver: 7.5.4 + dev: true + + /make-error-cause@2.3.0: + resolution: {integrity: sha512-etgt+n4LlOkGSJbBTV9VROHA5R7ekIPS4vfh+bCAoJgRrJWdqJCBbpS3osRJ/HrT7R68MzMiY3L3sDJ/Fd8aBg==} + dependencies: + make-error: 1.3.6 + dev: true + + /make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + dev: true + + /matcher@3.0.0: + resolution: {integrity: sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==} + engines: {node: '>=10'} + dependencies: + escape-string-regexp: 4.0.0 + dev: true + + /matcher@5.0.0: + resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + escape-string-regexp: 5.0.0 + dev: true + + /math-random@1.0.4: + resolution: {integrity: sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==} + dev: true + + /media-typer@0.3.0: + resolution: {integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=} + engines: {node: '>= 0.6'} + dev: true + + /merge-descriptors@1.0.1: + resolution: {integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=} + dev: true + + /merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + dev: true + + /methods@1.1.2: + resolution: {integrity: sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=} + engines: {node: '>= 0.6'} + dev: true + + /micromatch@4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: true + + /mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: true + + /mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: true + + /mime@1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: true + + /mimic-response@3.1.0: + resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} + engines: {node: '>=10'} + dev: true + + /mimic-response@4.0.0: + resolution: {integrity: sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + + /min-indent@1.0.1: + resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} + engines: {node: '>=4'} + dev: true + + /minimatch@3.0.4: + resolution: {integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==} + dependencies: + brace-expansion: 1.1.11 + dev: true + + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + + /minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + + /minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: true + + /minipass@7.0.4: + resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} + engines: {node: '>=16 || 14 >=14.17'} + dev: true + + /mkdirp-classic@0.5.3: + resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} + dev: true + + /mkdirp@0.5.4: + resolution: {integrity: sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==} + deprecated: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) + hasBin: true + dependencies: + minimist: 1.2.8 + dev: true + + /mkdirp@1.0.4: + resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} + engines: {node: '>=10'} + hasBin: true + dev: true + + /mocha@6.2.3: + resolution: {integrity: sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg==} + engines: {node: '>= 6.0.0'} + hasBin: true + dependencies: + ansi-colors: 3.2.3 + browser-stdout: 1.3.1 + debug: 3.2.6(supports-color@6.0.0) + diff: 3.5.0 + escape-string-regexp: 1.0.5 + find-up: 3.0.0 + glob: 7.1.3 + growl: 1.10.5 + he: 1.2.0 + js-yaml: 3.13.1 + log-symbols: 2.2.0 + minimatch: 3.0.4 + mkdirp: 0.5.4 + ms: 2.1.1 + node-environment-flags: 1.0.5 + object.assign: 4.1.0 + strip-json-comments: 2.0.1 + supports-color: 6.0.0 + which: 1.3.1 + wide-align: 1.1.3 + yargs: 13.3.2 + yargs-parser: 13.1.2 + yargs-unparser: 1.6.0 + dev: true + + /ms@2.0.0: + resolution: {integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=} + dev: true + + /ms@2.1.1: + resolution: {integrity: sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==} + dev: true + + /ms@2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + dev: true + + /ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: true + + /nanocolors@0.2.13: + resolution: {integrity: sha512-0n3mSAQLPpGLV9ORXT5+C/D4mwew7Ebws69Hx4E2sgz2ZA5+32Q80B9tL8PbL7XHnRDiAxH/pnrUJ9a4fkTNTA==} + dev: true + + /nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: true + + /nanoid@4.0.2: + resolution: {integrity: sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==} + engines: {node: ^14 || ^16 || >=18} + hasBin: true + dev: true + + /negotiator@0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + dev: true + + /nise@5.1.7: + resolution: {integrity: sha512-wWtNUhkT7k58uvWTB/Gy26eA/EJKtPZFVAhEilN5UYVmmGRYOURbejRUyKm0Uu9XVEW7K5nBOZfR8VMB4QR2RQ==} + dependencies: + '@sinonjs/commons': 3.0.1 + '@sinonjs/fake-timers': 11.2.2 + '@sinonjs/text-encoding': 0.7.2 + just-extend: 6.2.0 + path-to-regexp: 6.2.1 + dev: true + + /no-case@2.3.2: + resolution: {integrity: sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==} + dependencies: + lower-case: 1.1.4 + dev: true + + /node-environment-flags@1.0.5: + resolution: {integrity: sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==} + dependencies: + object.getownpropertydescriptors: 2.1.7 + semver: 5.7.2 + dev: true + + /node-fetch@2.6.7: + resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: true + + /normalize-newline@4.1.0: + resolution: {integrity: sha512-ff4jKqMI8Xl50/4Mms/9jPobzAV/UK+kXG2XJ/7AqOmxIx8mqfqTIHYxuAnEgJ2AQeBbLnlbmZ5+38Y9A0w/YA==} + engines: {node: '>=12'} + dependencies: + replace-buffer: 1.2.1 + dev: true + + /normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + dev: true + + /normalize-url@8.0.0: + resolution: {integrity: sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==} + engines: {node: '>=14.16'} + dev: true + + /object-assign@4.1.1: + resolution: {integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=} + engines: {node: '>=0.10.0'} + dev: true + + /object-inspect@1.13.1: + resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + dev: true + + /object-keys@1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + dev: true + + /object.assign@4.1.0: + resolution: {integrity: sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==} + engines: {node: '>= 0.4'} + dependencies: + define-properties: 1.2.1 + function-bind: 1.1.2 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: true + + /object.assign@4.1.5: + resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: true + + /object.getownpropertydescriptors@2.1.7: + resolution: {integrity: sha512-PrJz0C2xJ58FNn11XV2lr4Jt5Gzl94qpy9Lu0JlfEj14z88sqbSBJCBEzdlNUCzY2gburhbrwOZ5BHCmuNUy0g==} + engines: {node: '>= 0.8'} + dependencies: + array.prototype.reduce: 1.0.6 + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + safe-array-concat: 1.1.0 + dev: true + + /observable-fns@0.6.1: + resolution: {integrity: sha512-9gRK4+sRWzeN6AOewNBTLXir7Zl/i3GB6Yl26gK4flxz8BXVpD3kt8amREmWNb0mxYOGDotvE5a4N+PtGGKdkg==} + dev: true + + /on-finished@2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + dependencies: + ee-first: 1.1.1 + dev: true + + /once@1.4.0: + resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=} + dependencies: + wrappy: 1.0.2 + dev: true + + /onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + dependencies: + mimic-fn: 2.1.0 + dev: true + + /only@0.0.2: + resolution: {integrity: sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q=} + dev: true + + /open@8.4.2: + resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} + engines: {node: '>=12'} + dependencies: + define-lazy-prop: 2.0.0 + is-docker: 2.2.1 + is-wsl: 2.2.0 + dev: true + + /opentype.js@1.3.4: + resolution: {integrity: sha512-d2JE9RP/6uagpQAVtJoF0pJJA/fgai89Cc50Yp0EJHk+eLp6QQ7gBoblsnubRULNY132I0J1QKMJ+JTbMqz4sw==} + engines: {node: '>= 8.0.0'} + hasBin: true + dependencies: + string.prototype.codepointat: 0.2.1 + tiny-inflate: 1.0.3 + dev: true + + /p-cancelable@3.0.0: + resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} + engines: {node: '>=12.20'} + dev: true + + /p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + dependencies: + p-try: 2.2.0 + dev: true + + /p-locate@3.0.0: + resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} + engines: {node: '>=6'} + dependencies: + p-limit: 2.3.0 + dev: true + + /p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + dependencies: + p-limit: 2.3.0 + dev: true + + /p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + dev: true + + /pako@0.2.9: + resolution: {integrity: sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=} + dev: true + + /pako@2.1.0: + resolution: {integrity: sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==} + dev: true + + /param-case@2.1.1: + resolution: {integrity: sha1-35T9jPZTHs915r75oIWPvHK+Ikc=} + dependencies: + no-case: 2.3.2 + dev: true + + /parse-ms@2.1.0: + resolution: {integrity: sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==} + engines: {node: '>=6'} + dev: true + + /parse-ms@3.0.0: + resolution: {integrity: sha512-Tpb8Z7r7XbbtBTrM9UhpkzzaMrqA2VXMT3YChzYltwV3P3pM6t8wl7TvpMnSTosz1aQAdVib7kdoys7vYOPerw==} + engines: {node: '>=12'} + dev: true + + /parse5@6.0.1: + resolution: {integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==} + dev: true + + /parseurl@1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + dev: true + + /path-exists@3.0.0: + resolution: {integrity: sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=} + engines: {node: '>=4'} + dev: true + + /path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true + + /path-is-absolute@1.0.1: + resolution: {integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18=} + engines: {node: '>=0.10.0'} + dev: true + + /path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: true + + /path-scurry@1.10.1: + resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + lru-cache: 10.2.0 + minipass: 7.0.4 + dev: true + + /path-to-regexp@0.1.7: + resolution: {integrity: sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=} + dev: true + + /path-to-regexp@6.2.1: + resolution: {integrity: sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==} + dev: true + + /path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + dev: true + + /pathval@1.1.1: + resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + dev: true + + /pdf-merger-js@3.4.0: + resolution: {integrity: sha512-2LkaPYf49cp/QAhjE+n9LEZXVVOzCjZPGlB6fE3a0neW+fers6vz+0A9drQCYNesMbzZ6JttCUF8jJvgwNPHAA==} + dependencies: + pdfjs: 2.5.3 + dev: true + + /pdf2json@2.1.0: + resolution: {integrity: sha512-mXF9AIgnvq1DP/ZM2R28tAfxP2wKZHYa2DjV0R1KCwcqSzm5Iqh1XQq9rdfAt6dp2DuPP0VHZIaCALc2v1cL5A==} + engines: {node: '>=14.18.0', npm: '>=6.14.15'} + hasBin: true + dev: true + bundledDependencies: + - '@xmldom/xmldom' + + /pdfjs@2.5.3: + resolution: {integrity: sha512-XSFh7/znM7gJAVABFvrtIkxi6TcHyHUCYpwaRUv1h0ln2ZQel0s8nKgsvmo+D7IKkkXKEQNtMU/hdmF/MUeaHg==} + engines: {node: '>=7'} + dependencies: + '@rkusa/linebreak': 1.0.0 + opentype.js: 1.3.4 + pako: 2.1.0 + readable-stream: 3.6.2 + unorm: 1.6.0 + uuid: 8.3.2 + dev: true + + /pend@1.2.0: + resolution: {integrity: sha1-elfrVQpng/kRUzH89GY9XI4AelA=} + dev: true + + /picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: true + + /ping@0.4.4: + resolution: {integrity: sha512-56ZMC0j7SCsMMLdOoUg12VZCfj/+ZO+yfOSjaNCRrmZZr6GLbN2X/Ui56T15dI8NhiHckaw5X2pvyfAomanwqQ==} + engines: {node: '>=4.0.0'} + dev: true + + /pkg-dir@4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + dependencies: + find-up: 4.1.0 + dev: true + + /pretty-ms@7.0.1: + resolution: {integrity: sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==} + engines: {node: '>=10'} + dependencies: + parse-ms: 2.1.0 + dev: true + + /pretty-ms@8.0.0: + resolution: {integrity: sha512-ASJqOugUF1bbzI35STMBUpZqdfYKlJugy6JBziGi2EE+AL5JPJGSzvpeVXojxrr0ViUYoToUjb5kjSEGf7Y83Q==} + engines: {node: '>=14.16'} + dependencies: + parse-ms: 3.0.0 + dev: true + + /process-nextick-args@2.0.1: + resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + dev: true + + /progress@2.0.3: + resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} + engines: {node: '>=0.4.0'} + dev: true + + /proxy-addr@2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + dev: true + + /proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: true + + /public-ip@6.0.1: + resolution: {integrity: sha512-1/Mxa1MKrAQ4jF5IalECSBtB0W1FAtnG+9c5X16jjvV/Gx9fiRy7xXIrHlBGYjnTlai0zdZkM3LrpmASavmAEg==} + engines: {node: '>=14.16'} + dependencies: + aggregate-error: 4.0.1 + dns-socket: 4.2.2 + got: 12.6.1 + is-ip: 4.0.0 + dev: true + + /pump@3.0.0: + resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + dev: true + + /punycode@1.4.1: + resolution: {integrity: sha1-wNWmOycYgArY4esPpSachN1BhF4=} + dev: true + + /punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + dev: true + + /puppeteer@15.5.0: + resolution: {integrity: sha512-+vZPU8iBSdCx1Kn5hHas80fyo0TiVyMeqLGv/1dygX2HKhAZjO9YThadbRTCoTYq0yWw+w/CysldPsEekDtjDQ==} + engines: {node: '>=14.1.0'} + requiresBuild: true + dependencies: + cross-fetch: 3.1.5 + debug: 4.3.4 + devtools-protocol: 0.0.1019158 + extract-zip: 2.0.1 + https-proxy-agent: 5.0.1 + pkg-dir: 4.2.0 + progress: 2.0.3 + proxy-from-env: 1.1.0 + rimraf: 3.0.2 + tar-fs: 2.1.1 + unbzip2-stream: 1.4.3 + ws: 8.8.0 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: true + + /qs@6.11.0: + resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: true + + /qs@6.11.2: + resolution: {integrity: sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: true + + /queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: true + + /quick-lru@5.1.1: + resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} + engines: {node: '>=10'} + dev: true + + /randomatic@3.1.1: + resolution: {integrity: sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==} + engines: {node: '>= 0.10.0'} + dependencies: + is-number: 4.0.0 + kind-of: 6.0.3 + math-random: 1.0.4 + dev: true + + /range-parser@1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + dev: true + + /raw-body@2.5.1: + resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} + engines: {node: '>= 0.8'} + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: true + + /raw-body@2.5.2: + resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} + engines: {node: '>= 0.8'} + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: true + + /readable-stream@2.3.8: + resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + dev: true + + /readable-stream@3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + dev: true + + /readdirp@3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + dependencies: + picomatch: 2.3.1 + dev: true + + /realistic-structured-clone@3.0.0: + resolution: {integrity: sha512-rOjh4nuWkAqf9PWu6JVpOWD4ndI+JHfgiZeMmujYcPi+fvILUu7g6l26TC1K5aBIp34nV+jE1cDO75EKOfHC5Q==} + dependencies: + domexception: 1.0.1 + typeson: 6.1.0 + typeson-registry: 1.0.0-alpha.39 + dev: true + + /regexp.prototype.flags@1.5.1: + resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + set-function-name: 2.0.1 + dev: true + + /relateurl@0.2.7: + resolution: {integrity: sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=} + engines: {node: '>= 0.10'} + dev: true + + /replace-buffer@1.2.1: + resolution: {integrity: sha512-ly3OKwKu+3T55DjP5PjIMzxgz9lFx6dQnBmAIxryZyRKl8f22juy12ShOyuq8WrQE5UlFOseZgQZDua0iF9DHw==} + engines: {node: '>=4'} + dev: true + + /require-directory@2.1.1: + resolution: {integrity: sha1-jGStX9MNqxyXbiNE/+f3kqam30I=} + engines: {node: '>=0.10.0'} + dev: true + + /require-main-filename@2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + dev: true + + /resolve-alpn@1.2.1: + resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} + dev: true + + /resolve-path@1.4.0: + resolution: {integrity: sha512-i1xevIst/Qa+nA9olDxLWnLk8YZbi8R/7JPbCMcgyWaFR6bKWaexgJgEB5oc2PKMjYdrHynyz0NY+if+H98t1w==} + engines: {node: '>= 0.8'} + dependencies: + http-errors: 1.6.3 + path-is-absolute: 1.0.1 + dev: true + + /responselike@3.0.0: + resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} + engines: {node: '>=14.16'} + dependencies: + lowercase-keys: 3.0.0 + dev: true + + /restore-cursor@3.1.0: + resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} + engines: {node: '>=8'} + dependencies: + onetime: 5.1.2 + signal-exit: 3.0.7 + dev: true + + /reusify@1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + dev: true + + /rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + dev: true + + /rss-parser@3.13.0: + resolution: {integrity: sha512-7jWUBV5yGN3rqMMj7CZufl/291QAhvrrGpDNE4k/02ZchL0npisiYYqULF71jCEKoIiHvK/Q2e6IkDwPziT7+w==} + dependencies: + entities: 2.2.0 + xml2js: 0.5.0 + dev: true + + /run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + dependencies: + queue-microtask: 1.2.3 + dev: true + + /rxjs@7.8.1: + resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} + dependencies: + tslib: 2.6.2 + dev: true + + /safe-array-concat@1.1.0: + resolution: {integrity: sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==} + engines: {node: '>=0.4'} + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + has-symbols: 1.0.3 + isarray: 2.0.5 + dev: true + + /safe-buffer@5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + dev: true + + /safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + dev: true + + /safe-regex-test@1.0.2: + resolution: {integrity: sha512-83S9w6eFq12BBIJYvjMux6/dkirb8+4zJRA9cxNBVb7Wq5fJBW+Xze48WqR8pxua7bDuAaaAxtVVd4Idjp1dBQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + is-regex: 1.1.4 + dev: true + + /safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: true + + /sax@1.3.0: + resolution: {integrity: sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==} + dev: true + + /semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} + hasBin: true + dev: true + + /semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + dev: true + + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + + /send@0.18.0: + resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} + engines: {node: '>= 0.8.0'} + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.0 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.1 + transitivePeerDependencies: + - supports-color + dev: true + + /serve-static@1.15.0: + resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} + engines: {node: '>= 0.8.0'} + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.18.0 + transitivePeerDependencies: + - supports-color + dev: true + + /set-blocking@2.0.0: + resolution: {integrity: sha1-BF+XgtARrppoA93TgrJDkrPYkPc=} + dev: true + + /set-function-length@1.2.0: + resolution: {integrity: sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.1 + function-bind: 1.1.2 + get-intrinsic: 1.2.2 + gopd: 1.0.1 + has-property-descriptors: 1.0.1 + dev: true + + /set-function-name@2.0.1: + resolution: {integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.1 + functions-have-names: 1.2.3 + has-property-descriptors: 1.0.1 + dev: true + + /setprototypeof@1.1.0: + resolution: {integrity: sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==} + dev: true + + /setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + dev: true + + /shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: true + + /side-channel@1.0.4: + resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + object-inspect: 1.13.1 + dev: true + + /signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: true + + /signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + dev: true + + /sinon-chai@3.7.0(chai@4.4.1)(sinon@17.0.1): + resolution: {integrity: sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g==} + peerDependencies: + chai: ^4.0.0 + sinon: '>=4.0.0' + dependencies: + chai: 4.4.1 + sinon: 17.0.1 + dev: true + + /sinon@17.0.1: + resolution: {integrity: sha512-wmwE19Lie0MLT+ZYNpDymasPHUKTaZHUH/pKEubRXIzySv9Atnlw+BUMGCzWgV7b7wO+Hw6f1TEOr0IUnmU8/g==} + dependencies: + '@sinonjs/commons': 3.0.1 + '@sinonjs/fake-timers': 11.2.2 + '@sinonjs/samsam': 8.0.0 + diff: 5.1.0 + nise: 5.1.7 + supports-color: 7.2.0 + dev: true + + /slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + dev: true + + /slice-ansi@4.0.0: + resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + astral-regex: 2.0.0 + is-fullwidth-code-point: 3.0.0 + dev: true + + /socket.io-adapter@2.5.2: + resolution: {integrity: sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==} + dependencies: + ws: 8.11.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /socket.io-client@4.7.2: + resolution: {integrity: sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w==} + engines: {node: '>=10.0.0'} + dependencies: + '@socket.io/component-emitter': 3.1.0 + debug: 4.3.4 + engine.io-client: 6.5.3 + socket.io-parser: 4.2.4 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /socket.io-parser@4.2.4: + resolution: {integrity: sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==} + engines: {node: '>=10.0.0'} + dependencies: + '@socket.io/component-emitter': 3.1.0 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /socket.io@4.7.2: + resolution: {integrity: sha512-bvKVS29/I5fl2FGLNHuXlQaUH/BlzX1IN6S+NKLNZpBsPZIDH+90eQmCs2Railn4YUiww4SzUedJ6+uzwFnKLw==} + engines: {node: '>=10.2.0'} + dependencies: + accepts: 1.3.8 + base64id: 2.0.0 + cors: 2.8.5 + debug: 4.3.4 + engine.io: 6.5.2 + socket.io-adapter: 2.5.2 + socket.io-parser: 4.2.4 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + dev: true + + /source-map@0.7.4: + resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} + engines: {node: '>= 8'} + dev: true + + /spawn-wrap@2.0.0: + resolution: {integrity: sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==} + engines: {node: '>=8'} + dependencies: + foreground-child: 2.0.0 + is-windows: 1.0.2 + make-dir: 3.1.0 + rimraf: 3.0.2 + signal-exit: 3.0.7 + which: 2.0.2 + dev: true + + /sprintf-js@1.0.3: + resolution: {integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=} + dev: true + + /statuses@1.5.0: + resolution: {integrity: sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=} + engines: {node: '>= 0.6'} + dev: true + + /statuses@2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + dev: true + + /string-width@2.1.1: + resolution: {integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==} + engines: {node: '>=4'} + dependencies: + is-fullwidth-code-point: 2.0.0 + strip-ansi: 4.0.0 + dev: true + + /string-width@3.1.0: + resolution: {integrity: sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==} + engines: {node: '>=6'} + dependencies: + emoji-regex: 7.0.3 + is-fullwidth-code-point: 2.0.0 + strip-ansi: 5.2.0 + dev: true + + /string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + + /string-width@5.1.2: + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + engines: {node: '>=12'} + dependencies: + eastasianwidth: 0.2.0 + emoji-regex: 9.2.2 + strip-ansi: 7.1.0 + dev: true + + /string.prototype.codepointat@0.2.1: + resolution: {integrity: sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==} + dev: true + + /string.prototype.trim@1.2.8: + resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + dev: true + + /string.prototype.trimend@1.0.7: + resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + dev: true + + /string.prototype.trimstart@1.0.7: + resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} + dependencies: + call-bind: 1.0.5 + define-properties: 1.2.1 + es-abstract: 1.22.3 + dev: true + + /string_decoder@1.1.1: + resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + dependencies: + safe-buffer: 5.1.2 + dev: true + + /string_decoder@1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /strip-ansi@4.0.0: + resolution: {integrity: sha1-qEeQIusaw2iocTibY1JixQXuNo8=} + engines: {node: '>=4'} + dependencies: + ansi-regex: 3.0.1 + dev: true + + /strip-ansi@5.2.0: + resolution: {integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==} + engines: {node: '>=6'} + dependencies: + ansi-regex: 4.1.1 + dev: true + + /strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: true + + /strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} + dependencies: + ansi-regex: 6.0.1 + dev: true + + /strip-indent@4.0.0: + resolution: {integrity: sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==} + engines: {node: '>=12'} + dependencies: + min-indent: 1.0.1 + dev: true + + /strip-json-comments@2.0.1: + resolution: {integrity: sha1-PFMZQukIwml8DsNEhYwobHygpgo=} + engines: {node: '>=0.10.0'} + dev: true + + /strnum@1.0.5: + resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} + dev: true + + /stubborn-fs@1.2.5: + resolution: {integrity: sha512-H2N9c26eXjzL/S/K+i/RHHcFanE74dptvvjM8iwzwbVcWY/zjBbgRqF3K0DY4+OD+uTTASTBvDoxPDaPN02D7g==} + dev: true + + /supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + dependencies: + has-flag: 3.0.0 + dev: true + + /supports-color@6.0.0: + resolution: {integrity: sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==} + engines: {node: '>=6'} + dependencies: + has-flag: 3.0.0 + dev: true + + /supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /symbol-tree@3.2.4: + resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} + dev: true + + /systeminformation@5.21.24: + resolution: {integrity: sha512-xQada8ByGGFoRXJaUptGgddn3i7IjtSdqNdCKzB8xkzsM7pHnfLYBWxkPdGzhZ0Z/l+W1yo+aZQZ74d2isj8kw==} + engines: {node: '>=8.0.0'} + os: [darwin, linux, win32, freebsd, openbsd, netbsd, sunos, android] + hasBin: true + dev: true + + /tar-fs@2.1.1: + resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==} + dependencies: + chownr: 1.1.4 + mkdirp-classic: 0.5.3 + pump: 3.0.0 + tar-stream: 2.2.0 + dev: true + + /tar-stream@2.2.0: + resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} + engines: {node: '>=6'} + dependencies: + bl: 4.1.0 + end-of-stream: 1.4.4 + fs-constants: 1.0.0 + inherits: 2.0.4 + readable-stream: 3.6.2 + dev: true + + /threads@1.7.0: + resolution: {integrity: sha512-Mx5NBSHX3sQYR6iI9VYbgHKBLisyB+xROCBGjjWm1O9wb9vfLxdaGtmT/KCjUqMsSNW6nERzCW3T6H43LqjDZQ==} + dependencies: + callsites: 3.1.0 + debug: 4.3.4 + is-observable: 2.1.0 + observable-fns: 0.6.1 + optionalDependencies: + tiny-worker: 2.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /through2@4.0.2: + resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==} + dependencies: + readable-stream: 3.6.2 + dev: true + + /through@2.3.8: + resolution: {integrity: sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=} + dev: true + + /tiny-inflate@1.0.3: + resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==} + dev: true + + /tiny-worker@2.3.0: + resolution: {integrity: sha512-pJ70wq5EAqTAEl9IkGzA+fN0836rycEuz2Cn6yeZ6FRzlVS5IDOkFHpIoEsksPRQV34GDqXm65+OlnZqUSyK2g==} + dependencies: + esm: 3.2.25 + dev: true + + /to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: true + + /toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + dev: true + + /tr46@0.0.3: + resolution: {integrity: sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=} + dev: true + + /tr46@2.1.0: + resolution: {integrity: sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==} + engines: {node: '>=8'} + dependencies: + punycode: 2.3.1 + dev: true + + /tree-kill@1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true + dev: true + + /ts-node@10.9.2(@types/node@20.11.10)(typescript@5.1.6): + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 20.11.10 + acorn: 8.11.3 + acorn-walk: 8.3.2 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.1.6 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true + + /tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + dev: true + + /tsscmp@1.0.6: + resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==} + engines: {node: '>=0.6.x'} + dev: true + + /type-detect@4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + dev: true + + /type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + dev: true + + /type-fest@2.19.0: + resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} + engines: {node: '>=12.20'} + dev: true + + /type-fest@4.10.1: + resolution: {integrity: sha512-7ZnJYTp6uc04uYRISWtiX3DSKB/fxNQT0B5o1OUeCqiQiwF+JC9+rJiZIDrPrNCLLuTqyQmh4VdQqh/ZOkv9MQ==} + engines: {node: '>=16'} + dev: true + + /type-is@1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + dev: true + + /typed-array-buffer@1.0.0: + resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + is-typed-array: 1.1.12 + dev: true + + /typed-array-byte-length@1.0.0: + resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.5 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.12 + dev: true + + /typed-array-byte-offset@1.0.0: + resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.5 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.12 + dev: true + + /typed-array-length@1.0.4: + resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} + dependencies: + call-bind: 1.0.5 + for-each: 0.3.3 + is-typed-array: 1.1.12 + dev: true + + /typescript@5.1.6: + resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + + /typescript@5.3.3: + resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + + /typeson-registry@1.0.0-alpha.39: + resolution: {integrity: sha512-NeGDEquhw+yfwNhguLPcZ9Oj0fzbADiX4R0WxvoY8nGhy98IbzQy1sezjoEFWOywOboj/DWehI+/aUlRVrJnnw==} + engines: {node: '>=10.0.0'} + dependencies: + base64-arraybuffer-es6: 0.7.0 + typeson: 6.1.0 + whatwg-url: 8.7.0 + dev: true + + /typeson@6.1.0: + resolution: {integrity: sha512-6FTtyGr8ldU0pfbvW/eOZrEtEkczHRUtduBnA90Jh9kMPCiFNnXIon3vF41N0S4tV1HHQt4Hk1j4srpESziCaA==} + engines: {node: '>=0.1.14'} + dev: true + + /uglify-js@3.17.4: + resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} + engines: {node: '>=0.8.0'} + hasBin: true + dev: true + + /unbox-primitive@1.0.2: + resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} + dependencies: + call-bind: 1.0.5 + has-bigints: 1.0.2 + has-symbols: 1.0.3 + which-boxed-primitive: 1.0.2 + dev: true + + /unbzip2-stream@1.4.3: + resolution: {integrity: sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==} + dependencies: + buffer: 5.7.1 + through: 2.3.8 + dev: true + + /undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: true + + /unicode-trie@0.3.1: + resolution: {integrity: sha1-1nHd3YkQGgi6w3tqUWEBBgIFIIU=} + dependencies: + pako: 0.2.9 + tiny-inflate: 1.0.3 + dev: true + + /universalify@2.0.1: + resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} + engines: {node: '>= 10.0.0'} + dev: true + + /unorm@1.6.0: + resolution: {integrity: sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==} + engines: {node: '>= 0.4.0'} + dev: true + + /unpipe@1.0.0: + resolution: {integrity: sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=} + engines: {node: '>= 0.8'} + dev: true + + /upper-case@1.1.3: + resolution: {integrity: sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=} + dev: true + + /url@0.11.3: + resolution: {integrity: sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==} + dependencies: + punycode: 1.4.1 + qs: 6.11.2 + dev: true + + /util-deprecate@1.0.2: + resolution: {integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=} + dev: true + + /utils-merge@1.0.1: + resolution: {integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=} + engines: {node: '>= 0.4.0'} + dev: true + + /uuid@8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + hasBin: true + dev: true + + /uuid@9.0.1: + resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} + hasBin: true + dev: true + + /v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + dev: true + + /vary@1.1.2: + resolution: {integrity: sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=} + engines: {node: '>= 0.8'} + dev: true + + /webidl-conversions@3.0.1: + resolution: {integrity: sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=} + dev: true + + /webidl-conversions@4.0.2: + resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} + dev: true + + /webidl-conversions@6.1.0: + resolution: {integrity: sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==} + engines: {node: '>=10.4'} + dev: true + + /whatwg-url@5.0.0: + resolution: {integrity: sha1-lmRU6HZUYuN2RNNib2dCzotwll0=} + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + dev: true + + /whatwg-url@8.7.0: + resolution: {integrity: sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==} + engines: {node: '>=10'} + dependencies: + lodash: 4.17.21 + tr46: 2.1.0 + webidl-conversions: 6.1.0 + dev: true + + /which-boxed-primitive@1.0.2: + resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + dependencies: + is-bigint: 1.0.4 + is-boolean-object: 1.1.2 + is-number-object: 1.0.7 + is-string: 1.0.7 + is-symbol: 1.0.4 + dev: true + + /which-module@2.0.1: + resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} + dev: true + + /which-typed-array@1.1.13: + resolution: {integrity: sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.5 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.0 + dev: true + + /which@1.3.1: + resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /which@3.0.1: + resolution: {integrity: sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /wide-align@1.1.3: + resolution: {integrity: sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==} + dependencies: + string-width: 2.1.1 + dev: true + + /wrap-ansi@5.1.0: + resolution: {integrity: sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==} + engines: {node: '>=6'} + dependencies: + ansi-styles: 3.2.1 + string-width: 3.1.0 + strip-ansi: 5.2.0 + dev: true + + /wrap-ansi@6.2.0: + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + engines: {node: '>=8'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrap-ansi@8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} + dependencies: + ansi-styles: 6.2.1 + string-width: 5.1.2 + strip-ansi: 7.1.0 + dev: true + + /wrappy@1.0.2: + resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=} + dev: true + + /ws@7.5.9: + resolution: {integrity: sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==} + engines: {node: '>=8.3.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + + /ws@8.11.0: + resolution: {integrity: sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + + /ws@8.16.0: + resolution: {integrity: sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + + /ws@8.8.0: + resolution: {integrity: sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + + /xml-js@1.6.11: + resolution: {integrity: sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==} + hasBin: true + dependencies: + sax: 1.3.0 + dev: true + + /xml2js@0.5.0: + resolution: {integrity: sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==} + engines: {node: '>=4.0.0'} + dependencies: + sax: 1.3.0 + xmlbuilder: 11.0.1 + dev: true + + /xmlbuilder@11.0.1: + resolution: {integrity: sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==} + engines: {node: '>=4.0'} + dev: true + + /xmlhttprequest-ssl@2.0.0: + resolution: {integrity: sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==} + engines: {node: '>=0.4.0'} + dev: true + + /y18n@4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + dev: true + + /yallist@4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: true + + /yargs-parser@13.1.2: + resolution: {integrity: sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==} + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + dev: true + + /yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: true + + /yargs-unparser@1.6.0: + resolution: {integrity: sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==} + engines: {node: '>=6'} + dependencies: + flat: 4.1.1 + lodash: 4.17.21 + yargs: 13.3.2 + dev: true + + /yargs@13.3.2: + resolution: {integrity: sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==} + dependencies: + cliui: 5.0.0 + find-up: 3.0.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 3.1.0 + which-module: 2.0.1 + y18n: 4.0.3 + yargs-parser: 13.1.2 + dev: true + + /yauzl@2.10.0: + resolution: {integrity: sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=} + dependencies: + buffer-crc32: 0.2.13 + fd-slicer: 1.1.0 + dev: true + + /ylru@1.3.2: + resolution: {integrity: sha512-RXRJzMiK6U2ye0BlGGZnmpwJDPgakn6aNQ0A7gHRbD4I0uvK4TW6UqkK1V0pp9jskjJBAXd3dRrbzWkqJ+6cxA==} + engines: {node: '>= 4.0.0'} + dev: true + + /yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + dev: true diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..d914270 --- /dev/null +++ b/readme.md @@ -0,0 +1,31 @@ +# @apiclient.xyz/hetznercloud +an unofficial api client for the hetzner cloud api + +## Availabililty and Links +* [npmjs.org (npm package)](https://www.npmjs.com/package/@apiclient.xyz/hetznercloud) +* [gitlab.com (source)](https://gitlab.com/apiclient.xyz/hetznercloud) +* [github.com (source mirror)](https://github.com/apiclient.xyz/hetznercloud) +* [docs (typedoc)](https://apiclient.xyz.gitlab.io/hetznercloud/) + +## Status for master + +Status Category | Status Badge +-- | -- +GitLab Pipelines | [![pipeline status](https://gitlab.com/apiclient.xyz/hetznercloud/badges/master/pipeline.svg)](https://lossless.cloud) +GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/apiclient.xyz/hetznercloud/badges/master/coverage.svg)](https://lossless.cloud) +npm | [![npm downloads per month](https://badgen.net/npm/dy/@apiclient.xyz/hetznercloud)](https://lossless.cloud) +Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/apiclient.xyz/hetznercloud)](https://lossless.cloud) +TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud) +node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) +Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud) +PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@apiclient.xyz/hetznercloud)](https://lossless.cloud) +PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@apiclient.xyz/hetznercloud)](https://lossless.cloud) +BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@apiclient.xyz/hetznercloud)](https://lossless.cloud) + +## Usage +Use TypeScript for best in class intellisense +For further information read the linked docs at the top of this readme. + +## Legal +> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc) +| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) diff --git a/test/test.ts b/test/test.ts new file mode 100644 index 0000000..03ca288 --- /dev/null +++ b/test/test.ts @@ -0,0 +1,8 @@ +import { expect, expectAsync, tap } from '@push.rocks/tapbundle'; +import * as hetznercloud from '../ts/index.js' + +tap.test('first test', async () => { + console.log(hetznercloud) +}) + +tap.start() diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts new file mode 100644 index 0000000..a33265a --- /dev/null +++ b/ts/00_commitinfo_data.ts @@ -0,0 +1,8 @@ +/** + * autocreated commitinfo by @pushrocks/commitinfo + */ +export const commitinfo = { + name: '@apiclient.xyz/hetznercloud', + version: '1.0.2', + description: 'an unofficial api client for the hetzner cloud api' +} diff --git a/ts/hetznercloud.plugins.ts b/ts/hetznercloud.plugins.ts new file mode 100644 index 0000000..d00ae0c --- /dev/null +++ b/ts/hetznercloud.plugins.ts @@ -0,0 +1,4 @@ +const removeme = {}; +export { + removeme +} diff --git a/ts/index.ts b/ts/index.ts new file mode 100644 index 0000000..4ad7873 --- /dev/null +++ b/ts/index.ts @@ -0,0 +1,3 @@ +import * as plugins from './hetznercloud.plugins.js'; + +export let demoExport = 'Hi there! :) This is an exported string'; diff --git a/ts_openapi/.gitignore b/ts_openapi/.gitignore new file mode 100644 index 0000000..149b576 --- /dev/null +++ b/ts_openapi/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/ts_openapi/.openapi-generator-ignore b/ts_openapi/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/ts_openapi/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/ts_openapi/.openapi-generator/FILES b/ts_openapi/.openapi-generator/FILES new file mode 100644 index 0000000..e9cf48f --- /dev/null +++ b/ts_openapi/.openapi-generator/FILES @@ -0,0 +1,258 @@ +.gitignore +.openapi-generator-ignore +api.ts +api/actionsApi.ts +api/apis.ts +api/certificateActionsApi.ts +api/certificatesApi.ts +api/datacentersApi.ts +api/firewallActionsApi.ts +api/firewallsApi.ts +api/floatingIPActionsApi.ts +api/floatingIPsApi.ts +api/iSOsApi.ts +api/imageActionsApi.ts +api/imagesApi.ts +api/loadBalancerActionsApi.ts +api/loadBalancerTypesApi.ts +api/loadBalancersApi.ts +api/locationsApi.ts +api/networkActionsApi.ts +api/networksApi.ts +api/placementGroupsApi.ts +api/pricingApi.ts +api/primaryIPActionsApi.ts +api/primaryIPsApi.ts +api/sSHKeysApi.ts +api/serverActionsApi.ts +api/serverTypesApi.ts +api/serversApi.ts +api/volumeActionsApi.ts +api/volumesApi.ts +git_push.sh +model/action.ts +model/actionError.ts +model/actionResourcesInner.ts +model/actionResponse.ts +model/actionsResponse.ts +model/actionsResponseMeta.ts +model/actionsResponseMetaPagination.ts +model/addDeleteRouteRequest.ts +model/addSubnetRequest.ts +model/addTargetRequest.ts +model/addTargetRequestLabelSelector.ts +model/addTargetRequestServer.ts +model/addToPlacementGroupRequest.ts +model/applyToResourcesRequest.ts +model/assignFloatingIPRequest.ts +model/assignPrimaryIPRequest.ts +model/attachToNetworkRequest.ts +model/attachVolumeRequest.ts +model/certificate.ts +model/certificateResponse.ts +model/certificateStatus.ts +model/certificateStatusError.ts +model/certificateUsedByInner.ts +model/certificatesResponse.ts +model/changeDNSPTRRequest.ts +model/changeIPRangeRequest.ts +model/changeLoadbalancerDnsPtrRequest.ts +model/changeProtectionRequest.ts +model/changeProtectionRequest1.ts +model/changeProtectionRequest2.ts +model/changeTypeRequest.ts +model/createCertificateRequest.ts +model/createCertificateResponse.ts +model/createFirewallRequest.ts +model/createFirewallRequestApplyToInner.ts +model/createFirewallRequestApplyToInnerLabelSelector.ts +model/createFirewallRequestApplyToInnerServer.ts +model/createFirewallResponse.ts +model/createFloatingIPRequest.ts +model/createImageRequest.ts +model/createLoadBalancerRequest.ts +model/createLoadBalancerRequestLabels.ts +model/createNetworkRequest.ts +model/createNetworkRequestSubnetsInner.ts +model/createPlacementGroupRequest.ts +model/createPlacementGroupResponse.ts +model/createPrimaryIPRequest.ts +model/createPrimaryIPResponse.ts +model/createServerRequest.ts +model/createServerRequestFirewallsInner.ts +model/createServerRequestPublicNet.ts +model/createServerResponse.ts +model/createVolumeRequest.ts +model/datacentersGet200Response.ts +model/datacentersGet200ResponseDatacentersInner.ts +model/datacentersGet200ResponseDatacentersInnerLocation.ts +model/datacentersGet200ResponseDatacentersInnerServerTypes.ts +model/datacentersIdGet200Response.ts +model/deleteSubnetRequest.ts +model/deprecationInfo.ts +model/detachFromNetworkRequest.ts +model/firewall.ts +model/firewallAppliedToInner.ts +model/firewallAppliedToInnerAppliedToResourcesInner.ts +model/firewallAppliedToInnerAppliedToResourcesInnerServer.ts +model/firewallAppliedToInnerLabelSelector.ts +model/firewallApplyToResources.ts +model/firewallApplyToResourcesLabelSelector.ts +model/firewallApplyToResourcesServer.ts +model/firewallRemoveFromResources.ts +model/firewallResponse.ts +model/firewallsResponse.ts +model/floatingIpsGet200Response.ts +model/floatingIpsGet200ResponseFloatingIpsInner.ts +model/floatingIpsGet200ResponseFloatingIpsInnerDnsPtrInner.ts +model/floatingIpsGet200ResponseFloatingIpsInnerHomeLocation.ts +model/floatingIpsGet200ResponseFloatingIpsInnerProtection.ts +model/floatingIpsIdActionsGet200Response.ts +model/floatingIpsIdGet200Response.ts +model/floatingIpsPost201Response.ts +model/imagesGet200Response.ts +model/imagesGet200ResponseImagesInner.ts +model/imagesGet200ResponseImagesInnerCreatedFrom.ts +model/imagesIdActionsChangeProtectionPostRequest.ts +model/imagesIdGet200Response.ts +model/isosGet200Response.ts +model/isosGet200ResponseIsosInner.ts +model/isosIdGet200Response.ts +model/loadBalancerAlgorithm.ts +model/loadBalancerService.ts +model/loadBalancerServiceHTTP.ts +model/loadBalancerServiceHTTP1.ts +model/loadBalancerServiceHealthCheck.ts +model/loadBalancerServiceHealthCheckHttp.ts +model/loadBalancerTarget.ts +model/loadBalancerTargetHealthStatusInner.ts +model/loadBalancerTargetIP.ts +model/loadBalancerTargetLabelSelector.ts +model/loadBalancerTargetServer.ts +model/loadBalancerTargetTarget.ts +model/loadBalancerTypesGet200Response.ts +model/loadBalancerTypesGet200ResponseLoadBalancerTypesInner.ts +model/loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInner.ts +model/loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly.ts +model/loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly.ts +model/loadBalancerTypesIdGet200Response.ts +model/loadBalancersGet200Response.ts +model/loadBalancersGet200ResponseLoadBalancersInner.ts +model/loadBalancersGet200ResponseLoadBalancersInnerAlgorithm.ts +model/loadBalancersGet200ResponseLoadBalancersInnerLocation.ts +model/loadBalancersGet200ResponseLoadBalancersInnerPrivateNetInner.ts +model/loadBalancersGet200ResponseLoadBalancersInnerPublicNet.ts +model/loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4.ts +model/loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6.ts +model/loadBalancersIdActionsAttachToNetworkPostRequest.ts +model/loadBalancersIdActionsChangeAlgorithmPostRequest.ts +model/loadBalancersIdActionsChangeProtectionPostRequest.ts +model/loadBalancersIdActionsDeleteServicePostRequest.ts +model/loadBalancersIdActionsDetachFromNetworkPostRequest.ts +model/loadBalancersIdGet200Response.ts +model/loadBalancersIdMetricsGet200Response.ts +model/loadBalancersIdMetricsGet200ResponseMetrics.ts +model/loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue.ts +model/loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValueValuesInnerInner.ts +model/loadBalancersIdPutRequest.ts +model/loadBalancersPost201Response.ts +model/locationsGet200Response.ts +model/locationsIdGet200Response.ts +model/models.ts +model/networksGet200Response.ts +model/networksGet200ResponseNetworksInner.ts +model/networksGet200ResponseNetworksInnerProtection.ts +model/networksGet200ResponseNetworksInnerRoutesInner.ts +model/networksGet200ResponseNetworksInnerSubnetsInner.ts +model/networksPost201Response.ts +model/nullableAction.ts +model/placementGroup.ts +model/placementGroupNullable.ts +model/placementGroupResponse.ts +model/placementGroupsResponse.ts +model/pricingGet200Response.ts +model/pricingGet200ResponsePricing.ts +model/pricingGet200ResponsePricingFloatingIp.ts +model/pricingGet200ResponsePricingFloatingIpPriceMonthly.ts +model/pricingGet200ResponsePricingFloatingIpsInner.ts +model/pricingGet200ResponsePricingFloatingIpsInnerPricesInner.ts +model/pricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly.ts +model/pricingGet200ResponsePricingImage.ts +model/pricingGet200ResponsePricingLoadBalancerTypesInner.ts +model/pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInner.ts +model/pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly.ts +model/pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly.ts +model/pricingGet200ResponsePricingPrimaryIpsInner.ts +model/pricingGet200ResponsePricingPrimaryIpsInnerPricesInner.ts +model/pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly.ts +model/pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly.ts +model/pricingGet200ResponsePricingServerBackup.ts +model/pricingGet200ResponsePricingServerTypesInner.ts +model/pricingGet200ResponsePricingServerTypesInnerPricesInner.ts +model/pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly.ts +model/pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly.ts +model/pricingGet200ResponsePricingTraffic.ts +model/pricingGet200ResponsePricingVolume.ts +model/primaryIP.ts +model/primaryIPDatacenter.ts +model/primaryIPDnsPtrInner.ts +model/primaryIPResponse.ts +model/primaryIPsResponse.ts +model/rebuildServerRequest.ts +model/removeFromResourcesRequest.ts +model/removeTargetRequest.ts +model/rule.ts +model/serverPublicNetFirewall.ts +model/serverTypesGet200Response.ts +model/serverTypesGet200ResponseServerTypesInner.ts +model/serverTypesIdGet200Response.ts +model/serversGet200Response.ts +model/serversGet200ResponseServersInner.ts +model/serversGet200ResponseServersInnerDatacenter.ts +model/serversGet200ResponseServersInnerImage.ts +model/serversGet200ResponseServersInnerIso.ts +model/serversGet200ResponseServersInnerPrivateNetInner.ts +model/serversGet200ResponseServersInnerProtection.ts +model/serversGet200ResponseServersInnerPublicNet.ts +model/serversGet200ResponseServersInnerPublicNetIpv4.ts +model/serversGet200ResponseServersInnerPublicNetIpv6.ts +model/serversGet200ResponseServersInnerPublicNetIpv6DnsPtrInner.ts +model/serversGet200ResponseServersInnerServerType.ts +model/serversIdActionsAttachIsoPostRequest.ts +model/serversIdActionsChangeAliasIpsPostRequest.ts +model/serversIdActionsChangeDnsPtrPostRequest.ts +model/serversIdActionsChangeProtectionPostRequest.ts +model/serversIdActionsChangeTypePostRequest.ts +model/serversIdActionsCreateImagePost201Response.ts +model/serversIdActionsEnableRescuePost201Response.ts +model/serversIdActionsEnableRescuePostRequest.ts +model/serversIdActionsRebuildPost201Response.ts +model/serversIdActionsRequestConsolePost201Response.ts +model/serversIdDelete200Response.ts +model/serversIdGet200Response.ts +model/setRulesRequest.ts +model/sshKeysGet200Response.ts +model/sshKeysGet200ResponseSshKeysInner.ts +model/sshKeysIdPutRequest.ts +model/sshKeysPost201Response.ts +model/sshKeysPostRequest.ts +model/updateCertificateRequest.ts +model/updateFirewallRequest.ts +model/updateFloatingIPRequest.ts +model/updateImageRequest.ts +model/updateLoadBalancerService.ts +model/updateLoadBalancerServiceHealthCheck.ts +model/updateLoadBalancerServiceHealthCheckHttp.ts +model/updateNetworkRequest.ts +model/updateNetworkRequestLabels.ts +model/updatePlacementGroupRequest.ts +model/updatePrimaryIPRequest.ts +model/updateServerRequest.ts +model/updateVolumeRequest.ts +model/volumesGet200Response.ts +model/volumesGet200ResponseVolumesInner.ts +model/volumesGet200ResponseVolumesInnerLocation.ts +model/volumesIdActionsChangeProtectionPostRequest.ts +model/volumesIdActionsResizePostRequest.ts +model/volumesIdGet200Response.ts +model/volumesPost201Response.ts diff --git a/ts_openapi/.openapi-generator/VERSION b/ts_openapi/.openapi-generator/VERSION new file mode 100644 index 0000000..4b49d9b --- /dev/null +++ b/ts_openapi/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.2.0 \ No newline at end of file diff --git a/ts_openapi/api.ts b/ts_openapi/api.ts new file mode 100644 index 0000000..b1119f1 --- /dev/null +++ b/ts_openapi/api.ts @@ -0,0 +1,3 @@ +// This is the entrypoint for the package +export * from './api/apis'; +export * from './model/models'; diff --git a/ts_openapi/api/actionsApi.ts b/ts_openapi/api/actionsApi.ts new file mode 100644 index 0000000..56325d5 --- /dev/null +++ b/ts_openapi/api/actionsApi.ts @@ -0,0 +1,258 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { ActionResponse } from '../model/actionResponse'; +import { ActionsResponse } from '../model/actionsResponse'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum ActionsApiApiKeys { +} + +export class ActionsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: ActionsApiApiKeys, value: string) { + (this.authentications as any)[ActionsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Action objects. You can `sort` the results by using the sort URI parameter, and filter them with the `status` parameter. + * @summary Get all Actions + * @param id Can be used multiple times, the response will contain only Actions with specified IDs. + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async actionsGet (id?: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/actions'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (id !== undefined) { + localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action object. + * @summary Get an Action + * @param id ID of the Resource + */ + public async actionsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/actions/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling actionsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/apis.ts b/ts_openapi/api/apis.ts new file mode 100644 index 0000000..3a0605a --- /dev/null +++ b/ts_openapi/api/apis.ts @@ -0,0 +1,66 @@ +export * from './actionsApi'; +import { ActionsApi } from './actionsApi'; +export * from './certificateActionsApi'; +import { CertificateActionsApi } from './certificateActionsApi'; +export * from './certificatesApi'; +import { CertificatesApi } from './certificatesApi'; +export * from './datacentersApi'; +import { DatacentersApi } from './datacentersApi'; +export * from './firewallActionsApi'; +import { FirewallActionsApi } from './firewallActionsApi'; +export * from './firewallsApi'; +import { FirewallsApi } from './firewallsApi'; +export * from './floatingIPActionsApi'; +import { FloatingIPActionsApi } from './floatingIPActionsApi'; +export * from './floatingIPsApi'; +import { FloatingIPsApi } from './floatingIPsApi'; +export * from './iSOsApi'; +import { ISOsApi } from './iSOsApi'; +export * from './imageActionsApi'; +import { ImageActionsApi } from './imageActionsApi'; +export * from './imagesApi'; +import { ImagesApi } from './imagesApi'; +export * from './loadBalancerActionsApi'; +import { LoadBalancerActionsApi } from './loadBalancerActionsApi'; +export * from './loadBalancerTypesApi'; +import { LoadBalancerTypesApi } from './loadBalancerTypesApi'; +export * from './loadBalancersApi'; +import { LoadBalancersApi } from './loadBalancersApi'; +export * from './locationsApi'; +import { LocationsApi } from './locationsApi'; +export * from './networkActionsApi'; +import { NetworkActionsApi } from './networkActionsApi'; +export * from './networksApi'; +import { NetworksApi } from './networksApi'; +export * from './placementGroupsApi'; +import { PlacementGroupsApi } from './placementGroupsApi'; +export * from './pricingApi'; +import { PricingApi } from './pricingApi'; +export * from './primaryIPActionsApi'; +import { PrimaryIPActionsApi } from './primaryIPActionsApi'; +export * from './primaryIPsApi'; +import { PrimaryIPsApi } from './primaryIPsApi'; +export * from './sSHKeysApi'; +import { SSHKeysApi } from './sSHKeysApi'; +export * from './serverActionsApi'; +import { ServerActionsApi } from './serverActionsApi'; +export * from './serverTypesApi'; +import { ServerTypesApi } from './serverTypesApi'; +export * from './serversApi'; +import { ServersApi } from './serversApi'; +export * from './volumeActionsApi'; +import { VolumeActionsApi } from './volumeActionsApi'; +export * from './volumesApi'; +import { VolumesApi } from './volumesApi'; +import * as http from 'http'; + +export class HttpError extends Error { + constructor (public response: http.IncomingMessage, public body: any, public statusCode?: number) { + super('HTTP request failed'); + this.name = 'HttpError'; + } +} + +export { RequestFile } from '../model/models'; + +export const APIS = [ActionsApi, CertificateActionsApi, CertificatesApi, DatacentersApi, FirewallActionsApi, FirewallsApi, FloatingIPActionsApi, FloatingIPsApi, ISOsApi, ImageActionsApi, ImagesApi, LoadBalancerActionsApi, LoadBalancerTypesApi, LoadBalancersApi, LocationsApi, NetworkActionsApi, NetworksApi, PlacementGroupsApi, PricingApi, PrimaryIPActionsApi, PrimaryIPsApi, SSHKeysApi, ServerActionsApi, ServerTypesApi, ServersApi, VolumeActionsApi, VolumesApi]; diff --git a/ts_openapi/api/certificateActionsApi.ts b/ts_openapi/api/certificateActionsApi.ts new file mode 100644 index 0000000..081377e --- /dev/null +++ b/ts_openapi/api/certificateActionsApi.ts @@ -0,0 +1,501 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { ActionResponse } from '../model/actionResponse'; +import { ActionsResponse } from '../model/actionsResponse'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum CertificateActionsApiApiKeys { +} + +export class CertificateActionsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: CertificateActionsApiApiKeys, value: string) { + (this.authentications as any)[CertificateActionsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Action objects. You can `sort` the results by using the sort URI parameter, and filter them with the `status` and `id` parameter. + * @summary Get all Actions + * @param id Can be used multiple times, the response will contain only Actions with specified IDs. + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async certificatesActionsGet (id?: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/certificates/actions'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (id !== undefined) { + localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action object. + * @summary Get an Action + * @param id ID of the Action. + */ + public async certificatesActionsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/certificates/actions/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling certificatesActionsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action for a Certificate. Only type `managed` Certificates have Actions. + * @summary Get an Action for a Certificate + * @param id ID of the Certificate + * @param actionId ID of the Action + */ + public async certificatesIdActionsActionIdGet (id: number, actionId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/certificates/{id}/actions/{action_id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))) + .replace('{' + 'action_id' + '}', encodeURIComponent(String(actionId))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling certificatesIdActionsActionIdGet.'); + } + + // verify required parameter 'actionId' is not null or undefined + if (actionId === null || actionId === undefined) { + throw new Error('Required parameter actionId was null or undefined when calling certificatesIdActionsActionIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns all Action objects for a Certificate. You can sort the results by using the `sort` URI parameter, and filter them with the `status` parameter. Only type `managed` Certificates can have Actions. For type `uploaded` Certificates the `actions` key will always contain an empty array. + * @summary Get all Actions for a Certificate + * @param id ID of the Action. + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async certificatesIdActionsGet (id: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/certificates/{id}/actions' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling certificatesIdActionsGet.'); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Retry a failed Certificate issuance or renewal. Only applicable if the type of the Certificate is `managed` and the issuance or renewal status is `failed`. #### Call specific error codes | Code | Description | |---------------------------------------------------------|---------------------------------------------------------------------------| | `caa_record_does_not_allow_ca` | CAA record does not allow certificate authority | | `ca_dns_validation_failed` | Certificate Authority: DNS validation failed | | `ca_too_many_authorizations_failed_recently` | Certificate Authority: Too many authorizations failed recently | | `ca_too_many_certificates_issued_for_registered_domain` | Certificate Authority: Too many certificates issued for registered domain | | `ca_too_many_duplicate_certificates` | Certificate Authority: Too many duplicate certificates | | `could_not_verify_domain_delegated_to_zone` | Could not verify domain delegated to zone | | `dns_zone_not_found` | DNS zone not found | | `dns_zone_is_secondary_zone` | DNS zone is a secondary zone | + * @summary Retry Issuance or Renewal + * @param id ID of the Certificate + */ + public async certificatesIdActionsRetryPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/certificates/{id}/actions/retry' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling certificatesIdActionsRetryPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/certificatesApi.ts b/ts_openapi/api/certificatesApi.ts new file mode 100644 index 0000000..190be26 --- /dev/null +++ b/ts_openapi/api/certificatesApi.ts @@ -0,0 +1,471 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { CertificateResponse } from '../model/certificateResponse'; +import { CertificatesResponse } from '../model/certificatesResponse'; +import { CreateCertificateRequest } from '../model/createCertificateRequest'; +import { CreateCertificateResponse } from '../model/createCertificateResponse'; +import { UpdateCertificateRequest } from '../model/updateCertificateRequest'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum CertificatesApiApiKeys { +} + +export class CertificatesApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: CertificatesApiApiKeys, value: string) { + (this.authentications as any)[CertificatesApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Certificate objects. + * @summary Get all Certificates + * @param sort Can be used multiple times. + * @param name Can be used to filter resources by their name. The response will only contain the resources matching the specified name + * @param labelSelector Can be used to filter resources by labels. The response will only contain resources matching the label selector. + * @param type Can be used multiple times. The response will only contain Certificates matching the type. + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async certificatesGet (sort?: 'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc', name?: string, labelSelector?: string, type?: 'uploaded' | 'managed', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CertificatesResponse; }> { + const localVarPath = this.basePath + '/certificates'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc'"); + } + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (labelSelector !== undefined) { + localVarQueryParameters['label_selector'] = ObjectSerializer.serialize(labelSelector, "string"); + } + + if (type !== undefined) { + localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "'uploaded' | 'managed'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CertificatesResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "CertificatesResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Deletes a Certificate. + * @summary Delete a Certificate + * @param id ID of the resource + */ + public async certificatesIdDelete (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/certificates/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling certificatesIdDelete.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Gets a specific Certificate object. + * @summary Get a Certificate + * @param id ID of the resource + */ + public async certificatesIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CertificateResponse; }> { + const localVarPath = this.basePath + '/certificates/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling certificatesIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CertificateResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "CertificateResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Updates the Certificate properties. Note that when updating labels, the Certificate’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body. Note: if the Certificate object changes during the request, the response will be a “conflict” error. + * @summary Update a Certificate + * @param id ID of the resource + * @param updateCertificateRequest + */ + public async certificatesIdPut (id: number, updateCertificateRequest?: UpdateCertificateRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CertificateResponse; }> { + const localVarPath = this.basePath + '/certificates/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling certificatesIdPut.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'PUT', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(updateCertificateRequest, "UpdateCertificateRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CertificateResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "CertificateResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Creates a new Certificate. The default type **uploaded** allows for uploading your existing `certificate` and `private_key` in PEM format. You have to monitor its expiration date and handle renewal yourself. In contrast, type **managed** requests a new Certificate from *Let\'s Encrypt* for the specified `domain_names`. Only domains managed by *Hetzner DNS* are supported. We handle renewal and timely alert the project owner via email if problems occur. For type `managed` Certificates the `action` key of the response contains the Action that allows for tracking the issuance process. For type `uploaded` Certificates the `action` is always null. + * @summary Create a Certificate + * @param createCertificateRequest + */ + public async certificatesPost (createCertificateRequest?: CreateCertificateRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateCertificateResponse; }> { + const localVarPath = this.basePath + '/certificates'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createCertificateRequest, "CreateCertificateRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CreateCertificateResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "CreateCertificateResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/datacentersApi.ts b/ts_openapi/api/datacentersApi.ts new file mode 100644 index 0000000..4d43ba5 --- /dev/null +++ b/ts_openapi/api/datacentersApi.ts @@ -0,0 +1,253 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { DatacentersGet200Response } from '../model/datacentersGet200Response'; +import { DatacentersIdGet200Response } from '../model/datacentersIdGet200Response'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum DatacentersApiApiKeys { +} + +export class DatacentersApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: DatacentersApiApiKeys, value: string) { + (this.authentications as any)[DatacentersApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Datacenter objects. + * @summary Get all Datacenters + * @param name Can be used to filter Datacenters by their name. The response will only contain the Datacenter matching the specified name. When the name does not match the Datacenter name format, an `invalid_input` error is returned. + * @param sort Can be used multiple times. + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async datacentersGet (name?: string, sort?: 'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: DatacentersGet200Response; }> { + const localVarPath = this.basePath + '/datacenters'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: DatacentersGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "DatacentersGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Datacenter object. + * @summary Get a Datacenter + * @param id ID of Datacenter + */ + public async datacentersIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: DatacentersIdGet200Response; }> { + const localVarPath = this.basePath + '/datacenters/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling datacentersIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: DatacentersIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "DatacentersIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/firewallActionsApi.ts b/ts_openapi/api/firewallActionsApi.ts new file mode 100644 index 0000000..2b49dfe --- /dev/null +++ b/ts_openapi/api/firewallActionsApi.ts @@ -0,0 +1,654 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { ActionResponse } from '../model/actionResponse'; +import { ActionsResponse } from '../model/actionsResponse'; +import { ApplyToResourcesRequest } from '../model/applyToResourcesRequest'; +import { RemoveFromResourcesRequest } from '../model/removeFromResourcesRequest'; +import { SetRulesRequest } from '../model/setRulesRequest'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum FirewallActionsApiApiKeys { +} + +export class FirewallActionsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: FirewallActionsApiApiKeys, value: string) { + (this.authentications as any)[FirewallActionsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Action objects. You can `sort` the results by using the sort URI parameter, and filter them with the `status` and `id` parameter. + * @summary Get all Actions + * @param id Can be used multiple times, the response will contain only Actions with specified IDs. + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async firewallsActionsGet (id?: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/firewalls/actions'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (id !== undefined) { + localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action object. + * @summary Get an Action + * @param id ID of the Resource + */ + public async firewallsActionsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/firewalls/actions/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling firewallsActionsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action for a Firewall. + * @summary Get an Action for a Firewall + * @param id ID of the Firewall + * @param actionId ID of the Action + */ + public async firewallsIdActionsActionIdGet (id: number, actionId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/firewalls/{id}/actions/{action_id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))) + .replace('{' + 'action_id' + '}', encodeURIComponent(String(actionId))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling firewallsIdActionsActionIdGet.'); + } + + // verify required parameter 'actionId' is not null or undefined + if (actionId === null || actionId === undefined) { + throw new Error('Required parameter actionId was null or undefined when calling firewallsIdActionsActionIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Applies one Firewall to multiple resources. Currently servers (public network interface) and label selectors are supported. #### Call specific error codes | Code | Description | |-------------------------------|---------------------------------------------------------------| | `firewall_already_applied` | Firewall was already applied on resource | | `incompatible_network_type` | The Network type is incompatible for the given resource | | `firewall_resource_not_found` | The resource the Firewall should be attached to was not found | + * @summary Apply to Resources + * @param id ID of the Firewall + * @param applyToResourcesRequest + */ + public async firewallsIdActionsApplyToResourcesPost (id: number, applyToResourcesRequest?: ApplyToResourcesRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/firewalls/{id}/actions/apply_to_resources' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling firewallsIdActionsApplyToResourcesPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(applyToResourcesRequest, "ApplyToResourcesRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns all Action objects for a Firewall. You can sort the results by using the `sort` URI parameter, and filter them with the `status` parameter. + * @summary Get all Actions for a Firewall + * @param id ID of the Action. + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async firewallsIdActionsGet (id: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/firewalls/{id}/actions' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling firewallsIdActionsGet.'); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Removes one Firewall from multiple resources. Currently only Servers (and their public network interfaces) are supported. #### Call specific error codes | Code | Description | |---------------------------------------|------------------------------------------------------------------------| | `firewall_already_removed` | Firewall was already removed from the resource | | `firewall_resource_not_found` | The resource the Firewall should be attached to was not found | | `firewall_managed_by_label_selector` | Firewall was applied via label selector and cannot be removed manually | + * @summary Remove from Resources + * @param id ID of the Firewall + * @param removeFromResourcesRequest + */ + public async firewallsIdActionsRemoveFromResourcesPost (id: number, removeFromResourcesRequest?: RemoveFromResourcesRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/firewalls/{id}/actions/remove_from_resources' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling firewallsIdActionsRemoveFromResourcesPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(removeFromResourcesRequest, "RemoveFromResourcesRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Sets the rules of a Firewall. All existing rules will be overwritten. Pass an empty `rules` array to remove all rules. The maximum amount of rules that can be defined is 50. #### Call specific error codes | Code | Description | |-------------------------------|---------------------------------------------------------------| | `firewall_resource_not_found` | The resource the Firewall should be attached to was not found | + * @summary Set Rules + * @param id ID of the Firewall + * @param setRulesRequest + */ + public async firewallsIdActionsSetRulesPost (id: number, setRulesRequest?: SetRulesRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/firewalls/{id}/actions/set_rules' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling firewallsIdActionsSetRulesPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(setRulesRequest, "SetRulesRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/firewallsApi.ts b/ts_openapi/api/firewallsApi.ts new file mode 100644 index 0000000..17ea597 --- /dev/null +++ b/ts_openapi/api/firewallsApi.ts @@ -0,0 +1,466 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { CreateFirewallRequest } from '../model/createFirewallRequest'; +import { CreateFirewallResponse } from '../model/createFirewallResponse'; +import { FirewallResponse } from '../model/firewallResponse'; +import { FirewallsResponse } from '../model/firewallsResponse'; +import { UpdateFirewallRequest } from '../model/updateFirewallRequest'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum FirewallsApiApiKeys { +} + +export class FirewallsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: FirewallsApiApiKeys, value: string) { + (this.authentications as any)[FirewallsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Firewall objects. + * @summary Get all Firewalls + * @param sort Can be used multiple times. + * @param name Can be used to filter resources by their name. The response will only contain the resources matching the specified name + * @param labelSelector Can be used to filter resources by labels. The response will only contain resources matching the label selector. + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async firewallsGet (sort?: 'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc', name?: string, labelSelector?: string, page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: FirewallsResponse; }> { + const localVarPath = this.basePath + '/firewalls'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc'"); + } + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (labelSelector !== undefined) { + localVarQueryParameters['label_selector'] = ObjectSerializer.serialize(labelSelector, "string"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: FirewallsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "FirewallsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Deletes a Firewall. #### Call specific error codes | Code | Description | |--------------------- |-------------------------------------------| | `resource_in_use` | Firewall must not be in use to be deleted | + * @summary Delete a Firewall + * @param id ID of the resource + */ + public async firewallsIdDelete (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/firewalls/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling firewallsIdDelete.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Gets a specific Firewall object. + * @summary Get a Firewall + * @param id ID of the resource + */ + public async firewallsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: FirewallResponse; }> { + const localVarPath = this.basePath + '/firewalls/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling firewallsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: FirewallResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "FirewallResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Updates the Firewall. Note that when updating labels, the Firewall\'s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body. Note: if the Firewall object changes during the request, the response will be a “conflict” error. + * @summary Update a Firewall + * @param id ID of the resource + * @param updateFirewallRequest + */ + public async firewallsIdPut (id: number, updateFirewallRequest?: UpdateFirewallRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: FirewallResponse; }> { + const localVarPath = this.basePath + '/firewalls/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling firewallsIdPut.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'PUT', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(updateFirewallRequest, "UpdateFirewallRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: FirewallResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "FirewallResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Creates a new Firewall. #### Call specific error codes | Code | Description | |------------------------------ |-------------------------------------------------------------- | | `server_already_added` | Server added more than one time to resource | | `incompatible_network_type` | The Network type is incompatible for the given resource | | `firewall_resource_not_found` | The resource the Firewall should be attached to was not found | + * @summary Create a Firewall + * @param createFirewallRequest + */ + public async firewallsPost (createFirewallRequest?: CreateFirewallRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateFirewallResponse; }> { + const localVarPath = this.basePath + '/firewalls'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createFirewallRequest, "CreateFirewallRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CreateFirewallResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "CreateFirewallResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/floatingIPActionsApi.ts b/ts_openapi/api/floatingIPActionsApi.ts new file mode 100644 index 0000000..013c6f5 --- /dev/null +++ b/ts_openapi/api/floatingIPActionsApi.ts @@ -0,0 +1,727 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { ActionResponse } from '../model/actionResponse'; +import { ActionsResponse } from '../model/actionsResponse'; +import { AssignFloatingIPRequest } from '../model/assignFloatingIPRequest'; +import { ChangeDNSPTRRequest } from '../model/changeDNSPTRRequest'; +import { ChangeProtectionRequest } from '../model/changeProtectionRequest'; +import { FloatingIpsIdActionsGet200Response } from '../model/floatingIpsIdActionsGet200Response'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum FloatingIPActionsApiApiKeys { +} + +export class FloatingIPActionsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: FloatingIPActionsApiApiKeys, value: string) { + (this.authentications as any)[FloatingIPActionsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Action objects. You can `sort` the results by using the sort URI parameter, and filter them with the `status` and `id` parameter. + * @summary Get all Actions + * @param id Can be used multiple times, the response will contain only Actions with specified IDs. + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async floatingIpsActionsGet (id?: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/floating_ips/actions'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (id !== undefined) { + localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action object. + * @summary Get an Action + * @param id ID of the Action. + */ + public async floatingIpsActionsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/floating_ips/actions/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling floatingIpsActionsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action object for a Floating IP. + * @summary Get an Action for a Floating IP + * @param id ID of the Floating IP + * @param actionId ID of the Action + */ + public async floatingIpsIdActionsActionIdGet (id: number, actionId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/floating_ips/{id}/actions/{action_id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))) + .replace('{' + 'action_id' + '}', encodeURIComponent(String(actionId))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling floatingIpsIdActionsActionIdGet.'); + } + + // verify required parameter 'actionId' is not null or undefined + if (actionId === null || actionId === undefined) { + throw new Error('Required parameter actionId was null or undefined when calling floatingIpsIdActionsActionIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Assigns a Floating IP to a Server. + * @summary Assign a Floating IP to a Server + * @param id ID of the Floating IP + * @param assignFloatingIPRequest + */ + public async floatingIpsIdActionsAssignPost (id: number, assignFloatingIPRequest?: AssignFloatingIPRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/floating_ips/{id}/actions/assign' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling floatingIpsIdActionsAssignPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(assignFloatingIPRequest, "AssignFloatingIPRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the hostname that will appear when getting the hostname belonging to this Floating IP. + * @summary Change reverse DNS entry for a Floating IP + * @param id ID of the Floating IP + * @param changeDNSPTRRequest Select the IP address for which to change the DNS entry by passing `ip`. For a Floating IP of type `ipv4` this must exactly match the IP address of the Floating IP. For a Floating IP of type `ipv6` this must be a single IP within the IPv6 /64 range that belongs to this Floating IP. You can add up to 100 IPv6 reverse DNS entries. The target hostname is set by passing `dns_ptr`. + */ + public async floatingIpsIdActionsChangeDnsPtrPost (id: number, changeDNSPTRRequest?: ChangeDNSPTRRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/floating_ips/{id}/actions/change_dns_ptr' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling floatingIpsIdActionsChangeDnsPtrPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(changeDNSPTRRequest, "ChangeDNSPTRRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the protection configuration of the Floating IP. + * @summary Change Floating IP Protection + * @param id ID of the Floating IP + * @param changeProtectionRequest + */ + public async floatingIpsIdActionsChangeProtectionPost (id: number, changeProtectionRequest?: ChangeProtectionRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/floating_ips/{id}/actions/change_protection' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling floatingIpsIdActionsChangeProtectionPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(changeProtectionRequest, "ChangeProtectionRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns all Action objects for a Floating IP. You can sort the results by using the `sort` URI parameter, and filter them with the `status` parameter. + * @summary Get all Actions for a Floating IP + * @param id ID of the Floating IP + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async floatingIpsIdActionsGet (id: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: FloatingIpsIdActionsGet200Response; }> { + const localVarPath = this.basePath + '/floating_ips/{id}/actions' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling floatingIpsIdActionsGet.'); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: FloatingIpsIdActionsGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "FloatingIpsIdActionsGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Unassigns a Floating IP, resulting in it being unreachable. You may assign it to a Server again at a later time. + * @summary Unassign a Floating IP + * @param id ID of the Floating IP + */ + public async floatingIpsIdActionsUnassignPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/floating_ips/{id}/actions/unassign' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling floatingIpsIdActionsUnassignPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/floatingIPsApi.ts b/ts_openapi/api/floatingIPsApi.ts new file mode 100644 index 0000000..c8404ac --- /dev/null +++ b/ts_openapi/api/floatingIPsApi.ts @@ -0,0 +1,466 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { CreateFloatingIPRequest } from '../model/createFloatingIPRequest'; +import { FloatingIpsGet200Response } from '../model/floatingIpsGet200Response'; +import { FloatingIpsIdGet200Response } from '../model/floatingIpsIdGet200Response'; +import { FloatingIpsPost201Response } from '../model/floatingIpsPost201Response'; +import { UpdateFloatingIPRequest } from '../model/updateFloatingIPRequest'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum FloatingIPsApiApiKeys { +} + +export class FloatingIPsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: FloatingIPsApiApiKeys, value: string) { + (this.authentications as any)[FloatingIPsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Floating IP objects. + * @summary Get all Floating IPs + * @param name Can be used to filter Floating IPs by their name. The response will only contain the Floating IP matching the specified name. + * @param labelSelector Can be used to filter Floating IPs by labels. The response will only contain Floating IPs matching the label selector. + * @param sort Can be used multiple times. Choices id id:asc id:desc created created:asc created:desc + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async floatingIpsGet (name?: string, labelSelector?: string, sort?: 'id' | 'id:asc' | 'id:desc' | 'created' | 'created:asc' | 'created:desc', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: FloatingIpsGet200Response; }> { + const localVarPath = this.basePath + '/floating_ips'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (labelSelector !== undefined) { + localVarQueryParameters['label_selector'] = ObjectSerializer.serialize(labelSelector, "string"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'created' | 'created:asc' | 'created:desc'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: FloatingIpsGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "FloatingIpsGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Deletes a Floating IP. If it is currently assigned to a Server it will automatically get unassigned. + * @summary Delete a Floating IP + * @param id ID of the Floating IP + */ + public async floatingIpsIdDelete (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/floating_ips/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling floatingIpsIdDelete.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Floating IP object. + * @summary Get a Floating IP + * @param id ID of the Floating IP + */ + public async floatingIpsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: FloatingIpsIdGet200Response; }> { + const localVarPath = this.basePath + '/floating_ips/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling floatingIpsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: FloatingIpsIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "FloatingIpsIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Updates the description or labels of a Floating IP. Also note that when updating labels, the Floating IP’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body. + * @summary Update a Floating IP + * @param id ID of the Floating IP + * @param updateFloatingIPRequest + */ + public async floatingIpsIdPut (id: number, updateFloatingIPRequest?: UpdateFloatingIPRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: FloatingIpsIdGet200Response; }> { + const localVarPath = this.basePath + '/floating_ips/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling floatingIpsIdPut.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'PUT', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(updateFloatingIPRequest, "UpdateFloatingIPRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: FloatingIpsIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "FloatingIpsIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Creates a new Floating IP assigned to a Server. If you want to create a Floating IP that is not bound to a Server, you need to provide the `home_location` key instead of `server`. This can be either the ID or the name of the Location this IP shall be created in. Note that a Floating IP can be assigned to a Server in any Location later on. For optimal routing it is advised to use the Floating IP in the same Location it was created in. + * @summary Create a Floating IP + * @param createFloatingIPRequest The `type` argument is required while `home_location` and `server` are mutually exclusive. + */ + public async floatingIpsPost (createFloatingIPRequest?: CreateFloatingIPRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: FloatingIpsPost201Response; }> { + const localVarPath = this.basePath + '/floating_ips'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createFloatingIPRequest, "CreateFloatingIPRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: FloatingIpsPost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "FloatingIpsPost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/iSOsApi.ts b/ts_openapi/api/iSOsApi.ts new file mode 100644 index 0000000..09f9794 --- /dev/null +++ b/ts_openapi/api/iSOsApi.ts @@ -0,0 +1,258 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { IsosGet200Response } from '../model/isosGet200Response'; +import { IsosIdGet200Response } from '../model/isosIdGet200Response'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum ISOsApiApiKeys { +} + +export class ISOsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: ISOsApiApiKeys, value: string) { + (this.authentications as any)[ISOsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all available ISO objects. + * @summary Get all ISOs + * @param name Can be used to filter ISOs by their name. The response will only contain the ISO matching the specified name. + * @param architecture Return only ISOs with the given architecture. + * @param includeArchitectureWildcard Include Images with wildcard architecture (architecture is null). Works only if architecture filter is specified. + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async isosGet (name?: string, architecture?: string, includeArchitectureWildcard?: boolean, page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IsosGet200Response; }> { + const localVarPath = this.basePath + '/isos'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (architecture !== undefined) { + localVarQueryParameters['architecture'] = ObjectSerializer.serialize(architecture, "string"); + } + + if (includeArchitectureWildcard !== undefined) { + localVarQueryParameters['include_architecture_wildcard'] = ObjectSerializer.serialize(includeArchitectureWildcard, "boolean"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: IsosGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "IsosGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific ISO object. + * @summary Get an ISO + * @param id ID of the ISO + */ + public async isosIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: IsosIdGet200Response; }> { + const localVarPath = this.basePath + '/isos/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling isosIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: IsosIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "IsosIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/imageActionsApi.ts b/ts_openapi/api/imageActionsApi.ts new file mode 100644 index 0000000..b880d17 --- /dev/null +++ b/ts_openapi/api/imageActionsApi.ts @@ -0,0 +1,504 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { ActionResponse } from '../model/actionResponse'; +import { ActionsResponse } from '../model/actionsResponse'; +import { ImagesIdActionsChangeProtectionPostRequest } from '../model/imagesIdActionsChangeProtectionPostRequest'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum ImageActionsApiApiKeys { +} + +export class ImageActionsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: ImageActionsApiApiKeys, value: string) { + (this.authentications as any)[ImageActionsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Action objects. You can `sort` the results by using the sort URI parameter, and filter them with the `status` and `id` parameter. + * @summary Get all Actions + * @param id Can be used multiple times, the response will contain only Actions with specified IDs. + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async imagesActionsGet (id?: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/images/actions'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (id !== undefined) { + localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action object. + * @summary Get an Action + * @param id ID of the Resource + */ + public async imagesActionsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/images/actions/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling imagesActionsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action for an Image. + * @summary Get an Action for an Image + * @param id ID of the Image + * @param actionId ID of the Action + */ + public async imagesIdActionsActionIdGet (id: number, actionId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/images/{id}/actions/{action_id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))) + .replace('{' + 'action_id' + '}', encodeURIComponent(String(actionId))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling imagesIdActionsActionIdGet.'); + } + + // verify required parameter 'actionId' is not null or undefined + if (actionId === null || actionId === undefined) { + throw new Error('Required parameter actionId was null or undefined when calling imagesIdActionsActionIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the protection configuration of the Image. Can only be used on snapshots. + * @summary Change Image Protection + * @param id ID of the Image + * @param imagesIdActionsChangeProtectionPostRequest + */ + public async imagesIdActionsChangeProtectionPost (id: number, imagesIdActionsChangeProtectionPostRequest?: ImagesIdActionsChangeProtectionPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/images/{id}/actions/change_protection' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling imagesIdActionsChangeProtectionPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(imagesIdActionsChangeProtectionPostRequest, "ImagesIdActionsChangeProtectionPostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns all Action objects for an Image. You can sort the results by using the `sort` URI parameter, and filter them with the `status` parameter. + * @summary Get all Actions for an Image + * @param id ID of the Image + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async imagesIdActionsGet (id: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/images/{id}/actions' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling imagesIdActionsGet.'); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/imagesApi.ts b/ts_openapi/api/imagesApi.ts new file mode 100644 index 0000000..2bd5b08 --- /dev/null +++ b/ts_openapi/api/imagesApi.ts @@ -0,0 +1,422 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { ImagesGet200Response } from '../model/imagesGet200Response'; +import { ImagesIdGet200Response } from '../model/imagesIdGet200Response'; +import { UpdateImageRequest } from '../model/updateImageRequest'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum ImagesApiApiKeys { +} + +export class ImagesApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: ImagesApiApiKeys, value: string) { + (this.authentications as any)[ImagesApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Image objects. You can select specific Image types only and sort the results by using URI parameters. + * @summary Get all Images + * @param sort Can be used multiple times. + * @param type Can be used multiple times. + * @param status Can be used multiple times. The response will only contain Images matching the status. + * @param boundTo Can be used multiple times. Server ID linked to the Image. Only available for Images of type `backup` + * @param includeDeprecated Can be used multiple times. + * @param name Can be used to filter resources by their name. The response will only contain the resources matching the specified name + * @param labelSelector Can be used to filter resources by labels. The response will only contain resources matching the label selector. + * @param architecture Return only Images with the given architecture. + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async imagesGet (sort?: 'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc', type?: 'system' | 'snapshot' | 'backup' | 'app', status?: 'available' | 'creating', boundTo?: string, includeDeprecated?: boolean, name?: string, labelSelector?: string, architecture?: string, page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ImagesGet200Response; }> { + const localVarPath = this.basePath + '/images'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc'"); + } + + if (type !== undefined) { + localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "'system' | 'snapshot' | 'backup' | 'app'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'available' | 'creating'"); + } + + if (boundTo !== undefined) { + localVarQueryParameters['bound_to'] = ObjectSerializer.serialize(boundTo, "string"); + } + + if (includeDeprecated !== undefined) { + localVarQueryParameters['include_deprecated'] = ObjectSerializer.serialize(includeDeprecated, "boolean"); + } + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (labelSelector !== undefined) { + localVarQueryParameters['label_selector'] = ObjectSerializer.serialize(labelSelector, "string"); + } + + if (architecture !== undefined) { + localVarQueryParameters['architecture'] = ObjectSerializer.serialize(architecture, "string"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ImagesGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ImagesGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Deletes an Image. Only Images of type `snapshot` and `backup` can be deleted. + * @summary Delete an Image + * @param id ID of the Image + */ + public async imagesIdDelete (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/images/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling imagesIdDelete.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Image object. + * @summary Get an Image + * @param id ID of the Image + */ + public async imagesIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ImagesIdGet200Response; }> { + const localVarPath = this.basePath + '/images/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling imagesIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ImagesIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ImagesIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Updates the Image. You may change the description, convert a Backup Image to a Snapshot Image or change the Image labels. Only Images of type `snapshot` and `backup` can be updated. Note that when updating labels, the current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body. + * @summary Update an Image + * @param id ID of the Image + * @param updateImageRequest + */ + public async imagesIdPut (id: number, updateImageRequest?: UpdateImageRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ImagesIdGet200Response; }> { + const localVarPath = this.basePath + '/images/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling imagesIdPut.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'PUT', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(updateImageRequest, "UpdateImageRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ImagesIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ImagesIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/loadBalancerActionsApi.ts b/ts_openapi/api/loadBalancerActionsApi.ts new file mode 100644 index 0000000..46db06a --- /dev/null +++ b/ts_openapi/api/loadBalancerActionsApi.ts @@ -0,0 +1,1398 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { ActionResponse } from '../model/actionResponse'; +import { ActionsResponse } from '../model/actionsResponse'; +import { AddTargetRequest } from '../model/addTargetRequest'; +import { ChangeLoadbalancerDnsPtrRequest } from '../model/changeLoadbalancerDnsPtrRequest'; +import { ChangeTypeRequest } from '../model/changeTypeRequest'; +import { LoadBalancerService } from '../model/loadBalancerService'; +import { LoadBalancersIdActionsAttachToNetworkPostRequest } from '../model/loadBalancersIdActionsAttachToNetworkPostRequest'; +import { LoadBalancersIdActionsChangeAlgorithmPostRequest } from '../model/loadBalancersIdActionsChangeAlgorithmPostRequest'; +import { LoadBalancersIdActionsChangeProtectionPostRequest } from '../model/loadBalancersIdActionsChangeProtectionPostRequest'; +import { LoadBalancersIdActionsDeleteServicePostRequest } from '../model/loadBalancersIdActionsDeleteServicePostRequest'; +import { LoadBalancersIdActionsDetachFromNetworkPostRequest } from '../model/loadBalancersIdActionsDetachFromNetworkPostRequest'; +import { RemoveTargetRequest } from '../model/removeTargetRequest'; +import { UpdateLoadBalancerService } from '../model/updateLoadBalancerService'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum LoadBalancerActionsApiApiKeys { +} + +export class LoadBalancerActionsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: LoadBalancerActionsApiApiKeys, value: string) { + (this.authentications as any)[LoadBalancerActionsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Action objects. You can `sort` the results by using the sort URI parameter, and filter them with the `status` and `id` parameter. + * @summary Get all Actions + * @param id Can be used multiple times, the response will contain only Actions with specified IDs. + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async loadBalancersActionsGet (id?: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/load_balancers/actions'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (id !== undefined) { + localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action object. + * @summary Get an Action + * @param id ID of the Action. + */ + public async loadBalancersActionsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/actions/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersActionsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action for a Load Balancer. + * @summary Get an Action for a Load Balancer + * @param id ID of the Load Balancer + * @param actionId ID of the Action + */ + public async loadBalancersIdActionsActionIdGet (id: number, actionId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/{action_id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))) + .replace('{' + 'action_id' + '}', encodeURIComponent(String(actionId))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsActionIdGet.'); + } + + // verify required parameter 'actionId' is not null or undefined + if (actionId === null || actionId === undefined) { + throw new Error('Required parameter actionId was null or undefined when calling loadBalancersIdActionsActionIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Adds a service to a Load Balancer. #### Call specific error codes | Code | Description | |----------------------------|---------------------------------------------------------| | `source_port_already_used` | The source port you are trying to add is already in use | + * @summary Add Service + * @param id ID of the Load Balancer + * @param loadBalancerService + */ + public async loadBalancersIdActionsAddServicePost (id: number, loadBalancerService?: LoadBalancerService, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/add_service' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsAddServicePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(loadBalancerService, "LoadBalancerService") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Adds a target to a Load Balancer. #### Call specific error codes | Code | Description | |-----------------------------------------|-------------------------------------------------------------------------------------------------------| | `cloud_resource_ip_not_allowed` | The IP you are trying to add as a target belongs to a Hetzner Cloud resource | | `ip_not_owned` | The IP you are trying to add as a target is not owned by the Project owner | | `load_balancer_not_attached_to_network` | The Load Balancer is not attached to a network | | `robot_unavailable` | Robot was not available. The caller may retry the operation after a short delay. | | `server_not_attached_to_network` | The server you are trying to add as a target is not attached to the same network as the Load Balancer | | `target_already_defined` | The Load Balancer target you are trying to define is already defined | + * @summary Add Target + * @param id ID of the Load Balancer + * @param addTargetRequest + */ + public async loadBalancersIdActionsAddTargetPost (id: number, addTargetRequest?: AddTargetRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/add_target' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsAddTargetPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(addTargetRequest, "AddTargetRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Attach a Load Balancer to a Network. **Call specific error codes** | Code | Description | |----------------------------------|-----------------------------------------------------------------------| | `load_balancer_already_attached` | The Load Balancer is already attached to a network | | `ip_not_available` | The provided Network IP is not available | | `no_subnet_available` | No Subnet or IP is available for the Load Balancer within the network | + * @summary Attach a Load Balancer to a Network + * @param id ID of the Load Balancer + * @param loadBalancersIdActionsAttachToNetworkPostRequest + */ + public async loadBalancersIdActionsAttachToNetworkPost (id: number, loadBalancersIdActionsAttachToNetworkPostRequest?: LoadBalancersIdActionsAttachToNetworkPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/attach_to_network' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsAttachToNetworkPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(loadBalancersIdActionsAttachToNetworkPostRequest, "LoadBalancersIdActionsAttachToNetworkPostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Change the algorithm that determines to which target new requests are sent. + * @summary Change Algorithm + * @param id ID of the Load Balancer + * @param loadBalancersIdActionsChangeAlgorithmPostRequest + */ + public async loadBalancersIdActionsChangeAlgorithmPost (id: number, loadBalancersIdActionsChangeAlgorithmPostRequest?: LoadBalancersIdActionsChangeAlgorithmPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/change_algorithm' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsChangeAlgorithmPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(loadBalancersIdActionsChangeAlgorithmPostRequest, "LoadBalancersIdActionsChangeAlgorithmPostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the hostname that will appear when getting the hostname belonging to the public IPs (IPv4 and IPv6) of this Load Balancer. Floating IPs assigned to the Server are not affected by this. + * @summary Change reverse DNS entry for this Load Balancer + * @param id ID of the Load Balancer + * @param changeLoadbalancerDnsPtrRequest Select the IP address for which to change the DNS entry by passing `ip`. It can be either IPv4 or IPv6. The target hostname is set by passing `dns_ptr`. + */ + public async loadBalancersIdActionsChangeDnsPtrPost (id: number, changeLoadbalancerDnsPtrRequest?: ChangeLoadbalancerDnsPtrRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/change_dns_ptr' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsChangeDnsPtrPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(changeLoadbalancerDnsPtrRequest, "ChangeLoadbalancerDnsPtrRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the protection configuration of a Load Balancer. + * @summary Change Load Balancer Protection + * @param id ID of the Load Balancer + * @param loadBalancersIdActionsChangeProtectionPostRequest + */ + public async loadBalancersIdActionsChangeProtectionPost (id: number, loadBalancersIdActionsChangeProtectionPostRequest?: LoadBalancersIdActionsChangeProtectionPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/change_protection' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsChangeProtectionPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(loadBalancersIdActionsChangeProtectionPostRequest, "LoadBalancersIdActionsChangeProtectionPostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the type (Max Services, Max Targets and Max Connections) of a Load Balancer. **Call specific error codes** | Code | Description | |------------------------------|-----------------------------------------------------------------| | `invalid_load_balancer_type` | The Load Balancer type does not fit for the given Load Balancer | + * @summary Change the Type of a Load Balancer + * @param id ID of the Load Balancer + * @param changeTypeRequest + */ + public async loadBalancersIdActionsChangeTypePost (id: number, changeTypeRequest?: ChangeTypeRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/change_type' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsChangeTypePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(changeTypeRequest, "ChangeTypeRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Delete a service of a Load Balancer. + * @summary Delete Service + * @param id ID of the Load Balancer + * @param loadBalancersIdActionsDeleteServicePostRequest + */ + public async loadBalancersIdActionsDeleteServicePost (id: number, loadBalancersIdActionsDeleteServicePostRequest?: LoadBalancersIdActionsDeleteServicePostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/delete_service' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsDeleteServicePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(loadBalancersIdActionsDeleteServicePostRequest, "LoadBalancersIdActionsDeleteServicePostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Detaches a Load Balancer from a network. + * @summary Detach a Load Balancer from a Network + * @param id ID of the Load Balancer + * @param loadBalancersIdActionsDetachFromNetworkPostRequest + */ + public async loadBalancersIdActionsDetachFromNetworkPost (id: number, loadBalancersIdActionsDetachFromNetworkPostRequest?: LoadBalancersIdActionsDetachFromNetworkPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/detach_from_network' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsDetachFromNetworkPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(loadBalancersIdActionsDetachFromNetworkPostRequest, "LoadBalancersIdActionsDetachFromNetworkPostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Disable the public interface of a Load Balancer. The Load Balancer will be not accessible from the internet via its public IPs. #### Call specific error codes | Code | Description | |-------------------------------------------|--------------------------------------------------------------------------------| | `load_balancer_not_attached_to_network` | The Load Balancer is not attached to a network | | `targets_without_use_private_ip` | The Load Balancer has targets that use the public IP instead of the private IP | + * @summary Disable the public interface of a Load Balancer + * @param id ID of the Load Balancer + */ + public async loadBalancersIdActionsDisablePublicInterfacePost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/disable_public_interface' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsDisablePublicInterfacePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Enable the public interface of a Load Balancer. The Load Balancer will be accessible from the internet via its public IPs. + * @summary Enable the public interface of a Load Balancer + * @param id ID of the Load Balancer + */ + public async loadBalancersIdActionsEnablePublicInterfacePost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/enable_public_interface' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsEnablePublicInterfacePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns all Action objects for a Load Balancer. You can sort the results by using the `sort` URI parameter, and filter them with the `status` parameter. + * @summary Get all Actions for a Load Balancer + * @param id ID of the Load Balancer + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async loadBalancersIdActionsGet (id: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsGet.'); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Removes a target from a Load Balancer. + * @summary Remove Target + * @param id ID of the Load Balancer + * @param removeTargetRequest + */ + public async loadBalancersIdActionsRemoveTargetPost (id: number, removeTargetRequest?: RemoveTargetRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/remove_target' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsRemoveTargetPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(removeTargetRequest, "RemoveTargetRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Updates a Load Balancer Service. #### Call specific error codes | Code | Description | |----------------------------|---------------------------------------------------------| | `source_port_already_used` | The source port you are trying to add is already in use | + * @summary Update Service + * @param id ID of the Load Balancer + * @param updateLoadBalancerService + */ + public async loadBalancersIdActionsUpdateServicePost (id: number, updateLoadBalancerService?: UpdateLoadBalancerService, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/actions/update_service' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdActionsUpdateServicePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(updateLoadBalancerService, "UpdateLoadBalancerService") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/loadBalancerTypesApi.ts b/ts_openapi/api/loadBalancerTypesApi.ts new file mode 100644 index 0000000..443edb6 --- /dev/null +++ b/ts_openapi/api/loadBalancerTypesApi.ts @@ -0,0 +1,248 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { LoadBalancerTypesGet200Response } from '../model/loadBalancerTypesGet200Response'; +import { LoadBalancerTypesIdGet200Response } from '../model/loadBalancerTypesIdGet200Response'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum LoadBalancerTypesApiApiKeys { +} + +export class LoadBalancerTypesApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: LoadBalancerTypesApiApiKeys, value: string) { + (this.authentications as any)[LoadBalancerTypesApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Gets all Load Balancer type objects. + * @summary Get all Load Balancer Types + * @param name Can be used to filter Load Balancer types by their name. The response will only contain the Load Balancer type matching the specified name. + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async loadBalancerTypesGet (name?: string, page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LoadBalancerTypesGet200Response; }> { + const localVarPath = this.basePath + '/load_balancer_types'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: LoadBalancerTypesGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "LoadBalancerTypesGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Gets a specific Load Balancer type object. + * @summary Get a Load Balancer Type + * @param id ID of Load Balancer type + */ + public async loadBalancerTypesIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LoadBalancerTypesIdGet200Response; }> { + const localVarPath = this.basePath + '/load_balancer_types/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancerTypesIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: LoadBalancerTypesIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "LoadBalancerTypesIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/loadBalancersApi.ts b/ts_openapi/api/loadBalancersApi.ts new file mode 100644 index 0000000..6d4a870 --- /dev/null +++ b/ts_openapi/api/loadBalancersApi.ts @@ -0,0 +1,574 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { CreateLoadBalancerRequest } from '../model/createLoadBalancerRequest'; +import { LoadBalancersGet200Response } from '../model/loadBalancersGet200Response'; +import { LoadBalancersIdGet200Response } from '../model/loadBalancersIdGet200Response'; +import { LoadBalancersIdMetricsGet200Response } from '../model/loadBalancersIdMetricsGet200Response'; +import { LoadBalancersIdPutRequest } from '../model/loadBalancersIdPutRequest'; +import { LoadBalancersPost201Response } from '../model/loadBalancersPost201Response'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum LoadBalancersApiApiKeys { +} + +export class LoadBalancersApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: LoadBalancersApiApiKeys, value: string) { + (this.authentications as any)[LoadBalancersApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Gets all existing Load Balancers that you have available. + * @summary Get all Load Balancers + * @param sort Can be used multiple times. + * @param name Can be used to filter resources by their name. The response will only contain the resources matching the specified name + * @param labelSelector Can be used to filter resources by labels. The response will only contain resources matching the label selector. + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async loadBalancersGet (sort?: 'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc', name?: string, labelSelector?: string, page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LoadBalancersGet200Response; }> { + const localVarPath = this.basePath + '/load_balancers'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc'"); + } + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (labelSelector !== undefined) { + localVarQueryParameters['label_selector'] = ObjectSerializer.serialize(labelSelector, "string"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: LoadBalancersGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "LoadBalancersGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Deletes a Load Balancer. + * @summary Delete a Load Balancer + * @param id ID of the Load Balancer + */ + public async loadBalancersIdDelete (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/load_balancers/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdDelete.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Gets a specific Load Balancer object. + * @summary Get a Load Balancer + * @param id ID of the Load Balancer + */ + public async loadBalancersIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LoadBalancersIdGet200Response; }> { + const localVarPath = this.basePath + '/load_balancers/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: LoadBalancersIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "LoadBalancersIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * You must specify the type of metric to get: `open_connections`, `connections_per_second`, `requests_per_second` or `bandwidth`. You can also specify more than one type by comma separation, e.g. `requests_per_second,bandwidth`. Depending on the type you will get different time series data: |Type | Timeseries | Unit | Description | |---- |------------|------|-------------| | open_connections | open_connections | number | Open connections | | connections_per_second | connections_per_second | connections/s | Connections per second | | requests_per_second | requests_per_second | requests/s | Requests per second | | bandwidth | bandwidth.in | bytes/s | Ingress bandwidth | || bandwidth.out | bytes/s | Egress bandwidth | Metrics are available for the last 30 days only. If you do not provide the step argument we will automatically adjust it so that 200 samples are returned. We limit the number of samples to a maximum of 500 and will adjust the step parameter accordingly. + * @summary Get Metrics for a LoadBalancer + * @param id ID of the Load Balancer + * @param type Type of metrics to get + * @param start Start of period to get Metrics for (in ISO-8601 format) + * @param end End of period to get Metrics for (in ISO-8601 format) + * @param step Resolution of results in seconds + */ + public async loadBalancersIdMetricsGet (id: number, type: 'open_connections' | 'connections_per_second' | 'requests_per_second' | 'bandwidth', start: string, end: string, step?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LoadBalancersIdMetricsGet200Response; }> { + const localVarPath = this.basePath + '/load_balancers/{id}/metrics' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdMetricsGet.'); + } + + // verify required parameter 'type' is not null or undefined + if (type === null || type === undefined) { + throw new Error('Required parameter type was null or undefined when calling loadBalancersIdMetricsGet.'); + } + + // verify required parameter 'start' is not null or undefined + if (start === null || start === undefined) { + throw new Error('Required parameter start was null or undefined when calling loadBalancersIdMetricsGet.'); + } + + // verify required parameter 'end' is not null or undefined + if (end === null || end === undefined) { + throw new Error('Required parameter end was null or undefined when calling loadBalancersIdMetricsGet.'); + } + + if (type !== undefined) { + localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "'open_connections' | 'connections_per_second' | 'requests_per_second' | 'bandwidth'"); + } + + if (start !== undefined) { + localVarQueryParameters['start'] = ObjectSerializer.serialize(start, "string"); + } + + if (end !== undefined) { + localVarQueryParameters['end'] = ObjectSerializer.serialize(end, "string"); + } + + if (step !== undefined) { + localVarQueryParameters['step'] = ObjectSerializer.serialize(step, "string"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: LoadBalancersIdMetricsGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "LoadBalancersIdMetricsGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Updates a Load Balancer. You can update a Load Balancer’s name and a Load Balancer’s labels. Note that when updating labels, the Load Balancer’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body. Note: if the Load Balancer object changes during the request, the response will be a “conflict” error. + * @summary Update a Load Balancer + * @param id ID of the Load Balancer + * @param loadBalancersIdPutRequest + */ + public async loadBalancersIdPut (id: number, loadBalancersIdPutRequest?: LoadBalancersIdPutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LoadBalancersIdGet200Response; }> { + const localVarPath = this.basePath + '/load_balancers/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling loadBalancersIdPut.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'PUT', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(loadBalancersIdPutRequest, "LoadBalancersIdPutRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: LoadBalancersIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "LoadBalancersIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Creates a Load Balancer. #### Call specific error codes | Code | Description | |-----------------------------------------|-------------------------------------------------------------------------------------------------------| | `cloud_resource_ip_not_allowed` | The IP you are trying to add as a target belongs to a Hetzner Cloud resource | | `ip_not_owned` | The IP is not owned by the owner of the project of the Load Balancer | | `load_balancer_not_attached_to_network` | The Load Balancer is not attached to a network | | `robot_unavailable` | Robot was not available. The caller may retry the operation after a short delay. | | `server_not_attached_to_network` | The server you are trying to add as a target is not attached to the same network as the Load Balancer | | `source_port_already_used` | The source port you are trying to add is already in use | | `target_already_defined` | The Load Balancer target you are trying to define is already defined | + * @summary Create a Load Balancer + * @param createLoadBalancerRequest + */ + public async loadBalancersPost (createLoadBalancerRequest?: CreateLoadBalancerRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LoadBalancersPost201Response; }> { + const localVarPath = this.basePath + '/load_balancers'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createLoadBalancerRequest, "CreateLoadBalancerRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: LoadBalancersPost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "LoadBalancersPost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/locationsApi.ts b/ts_openapi/api/locationsApi.ts new file mode 100644 index 0000000..374ca76 --- /dev/null +++ b/ts_openapi/api/locationsApi.ts @@ -0,0 +1,253 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { LocationsGet200Response } from '../model/locationsGet200Response'; +import { LocationsIdGet200Response } from '../model/locationsIdGet200Response'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum LocationsApiApiKeys { +} + +export class LocationsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: LocationsApiApiKeys, value: string) { + (this.authentications as any)[LocationsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Location objects. + * @summary Get all Locations + * @param name Can be used to filter Locations by their name. The response will only contain the Location matching the specified name. + * @param sort Can be used multiple times. + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async locationsGet (name?: string, sort?: 'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LocationsGet200Response; }> { + const localVarPath = this.basePath + '/locations'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: LocationsGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "LocationsGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Location object. + * @summary Get a Location + * @param id ID of Location + */ + public async locationsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LocationsIdGet200Response; }> { + const localVarPath = this.basePath + '/locations/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling locationsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: LocationsIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "LocationsIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/networkActionsApi.ts b/ts_openapi/api/networkActionsApi.ts new file mode 100644 index 0000000..cb06e33 --- /dev/null +++ b/ts_openapi/api/networkActionsApi.ts @@ -0,0 +1,878 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { ActionResponse } from '../model/actionResponse'; +import { ActionsResponse } from '../model/actionsResponse'; +import { AddDeleteRouteRequest } from '../model/addDeleteRouteRequest'; +import { AddSubnetRequest } from '../model/addSubnetRequest'; +import { ChangeIPRangeRequest } from '../model/changeIPRangeRequest'; +import { ChangeProtectionRequest1 } from '../model/changeProtectionRequest1'; +import { DeleteSubnetRequest } from '../model/deleteSubnetRequest'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum NetworkActionsApiApiKeys { +} + +export class NetworkActionsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: NetworkActionsApiApiKeys, value: string) { + (this.authentications as any)[NetworkActionsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Action objects. You can `sort` the results by using the sort URI parameter, and filter them with the `status` and `id` parameter. + * @summary Get all Actions + * @param id Can be used multiple times, the response will contain only Actions with specified IDs. + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async networksActionsGet (id?: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/networks/actions'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (id !== undefined) { + localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action object. + * @summary Get an Action + * @param id ID of the Resource + */ + public async networksActionsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/networks/actions/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling networksActionsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action for a Network. + * @summary Get an Action for a Network + * @param id ID of the Network + * @param actionId ID of the Action + */ + public async networksIdActionsActionIdGet (id: number, actionId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/networks/{id}/actions/{action_id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))) + .replace('{' + 'action_id' + '}', encodeURIComponent(String(actionId))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling networksIdActionsActionIdGet.'); + } + + // verify required parameter 'actionId' is not null or undefined + if (actionId === null || actionId === undefined) { + throw new Error('Required parameter actionId was null or undefined when calling networksIdActionsActionIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Adds a route entry to a Network. Note: if the Network object changes during the request, the response will be a “conflict” error. + * @summary Add a route to a Network + * @param id ID of the Network + * @param addDeleteRouteRequest + */ + public async networksIdActionsAddRoutePost (id: number, addDeleteRouteRequest?: AddDeleteRouteRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/networks/{id}/actions/add_route' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling networksIdActionsAddRoutePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(addDeleteRouteRequest, "AddDeleteRouteRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Adds a new subnet object to the Network. If you do not specify an `ip_range` for the subnet we will automatically pick the first available /24 range for you if possible. Note: if the parent Network object changes during the request, the response will be a “conflict” error. + * @summary Add a subnet to a Network + * @param id ID of the Network + * @param addSubnetRequest + */ + public async networksIdActionsAddSubnetPost (id: number, addSubnetRequest?: AddSubnetRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/networks/{id}/actions/add_subnet' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling networksIdActionsAddSubnetPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(addSubnetRequest, "AddSubnetRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the IP range of a Network. IP ranges can only be extended and never shrunk. You can only add IPs at the end of an existing IP range. This means that the IP part of your existing range must stay the same and you can only change its netmask. For example if you have a range `10.0.0.0/16` you want to extend then your new range must also start with the IP `10.0.0.0`. Your CIDR netmask `/16` may change to a number that is smaller than `16` thereby increasing the IP range. So valid entries would be `10.0.0.0/15`, `10.0.0.0/14`, `10.0.0.0/13` and so on. After changing the IP range you will have to adjust the routes on your connected Servers by either rebooting them or manually changing the routes to your private Network interface. Note: if the Network object changes during the request, the response will be a “conflict” error. + * @summary Change IP range of a Network + * @param id ID of the Network + * @param changeIPRangeRequest + */ + public async networksIdActionsChangeIpRangePost (id: number, changeIPRangeRequest?: ChangeIPRangeRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/networks/{id}/actions/change_ip_range' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling networksIdActionsChangeIpRangePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(changeIPRangeRequest, "ChangeIPRangeRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the protection configuration of a Network. Note: if the Network object changes during the request, the response will be a “conflict” error. + * @summary Change Network Protection + * @param id ID of the Network + * @param changeProtectionRequest1 + */ + public async networksIdActionsChangeProtectionPost (id: number, changeProtectionRequest1?: ChangeProtectionRequest1, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/networks/{id}/actions/change_protection' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling networksIdActionsChangeProtectionPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(changeProtectionRequest1, "ChangeProtectionRequest1") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Delete a route entry from a Network. Note: if the Network object changes during the request, the response will be a “conflict” error. + * @summary Delete a route from a Network + * @param id ID of the Network + * @param addDeleteRouteRequest + */ + public async networksIdActionsDeleteRoutePost (id: number, addDeleteRouteRequest?: AddDeleteRouteRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/networks/{id}/actions/delete_route' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling networksIdActionsDeleteRoutePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(addDeleteRouteRequest, "AddDeleteRouteRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Deletes a single subnet entry from a Network. You cannot delete subnets which still have Servers attached. If you have Servers attached you first need to detach all Servers that use IPs from this subnet before you can delete the subnet. Note: if the Network object changes during the request, the response will be a “conflict” error. + * @summary Delete a subnet from a Network + * @param id ID of the Network + * @param deleteSubnetRequest + */ + public async networksIdActionsDeleteSubnetPost (id: number, deleteSubnetRequest?: DeleteSubnetRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/networks/{id}/actions/delete_subnet' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling networksIdActionsDeleteSubnetPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(deleteSubnetRequest, "DeleteSubnetRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns all Action objects for a Network. You can sort the results by using the `sort` URI parameter, and filter them with the `status` parameter. + * @summary Get all Actions for a Network + * @param id ID of the Network + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async networksIdActionsGet (id: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/networks/{id}/actions' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling networksIdActionsGet.'); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/networksApi.ts b/ts_openapi/api/networksApi.ts new file mode 100644 index 0000000..20c4c8c --- /dev/null +++ b/ts_openapi/api/networksApi.ts @@ -0,0 +1,460 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { CreateNetworkRequest } from '../model/createNetworkRequest'; +import { NetworksGet200Response } from '../model/networksGet200Response'; +import { NetworksPost201Response } from '../model/networksPost201Response'; +import { UpdateNetworkRequest } from '../model/updateNetworkRequest'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum NetworksApiApiKeys { +} + +export class NetworksApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: NetworksApiApiKeys, value: string) { + (this.authentications as any)[NetworksApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Gets all existing networks that you have available. + * @summary Get all Networks + * @param name Can be used to filter networks by their name. The response will only contain the networks matching the specified name. + * @param labelSelector Can be used to filter networks by labels. The response will only contain networks with a matching label selector pattern. + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async networksGet (name?: string, labelSelector?: string, page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NetworksGet200Response; }> { + const localVarPath = this.basePath + '/networks'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (labelSelector !== undefined) { + localVarQueryParameters['label_selector'] = ObjectSerializer.serialize(labelSelector, "string"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: NetworksGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "NetworksGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Deletes a network. If there are Servers attached they will be detached in the background. Note: if the network object changes during the request, the response will be a “conflict” error. + * @summary Delete a Network + * @param id ID of the network + */ + public async networksIdDelete (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/networks/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling networksIdDelete.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Gets a specific network object. + * @summary Get a Network + * @param id ID of the network + */ + public async networksIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NetworksPost201Response; }> { + const localVarPath = this.basePath + '/networks/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling networksIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: NetworksPost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "NetworksPost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Updates the network properties. Note that when updating labels, the network’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body. Note: if the network object changes during the request, the response will be a “conflict” error. + * @summary Update a Network + * @param id ID of the network + * @param updateNetworkRequest + */ + public async networksIdPut (id: number, updateNetworkRequest?: UpdateNetworkRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NetworksPost201Response; }> { + const localVarPath = this.basePath + '/networks/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling networksIdPut.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'PUT', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(updateNetworkRequest, "UpdateNetworkRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: NetworksPost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "NetworksPost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Creates a network with the specified `ip_range`. You may specify one or more `subnets`. You can also add more Subnets later by using the [add subnet action](https://docs.hetzner.cloud/#network-actions-add-a-subnet-to-a-network). If you do not specify an `ip_range` in the subnet we will automatically pick the first available /24 range for you. You may specify one or more routes in `routes`. You can also add more routes later by using the [add route action](https://docs.hetzner.cloud/#network-actions-add-a-route-to-a-network). + * @summary Create a Network + * @param createNetworkRequest + */ + public async networksPost (createNetworkRequest?: CreateNetworkRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NetworksPost201Response; }> { + const localVarPath = this.basePath + '/networks'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createNetworkRequest, "CreateNetworkRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: NetworksPost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "NetworksPost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/placementGroupsApi.ts b/ts_openapi/api/placementGroupsApi.ts new file mode 100644 index 0000000..7c78243 --- /dev/null +++ b/ts_openapi/api/placementGroupsApi.ts @@ -0,0 +1,471 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { CreatePlacementGroupRequest } from '../model/createPlacementGroupRequest'; +import { CreatePlacementGroupResponse } from '../model/createPlacementGroupResponse'; +import { PlacementGroupResponse } from '../model/placementGroupResponse'; +import { PlacementGroupsResponse } from '../model/placementGroupsResponse'; +import { UpdatePlacementGroupRequest } from '../model/updatePlacementGroupRequest'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum PlacementGroupsApiApiKeys { +} + +export class PlacementGroupsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: PlacementGroupsApiApiKeys, value: string) { + (this.authentications as any)[PlacementGroupsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all PlacementGroup objects. + * @summary Get all PlacementGroups + * @param sort Can be used multiple times. + * @param name Can be used to filter resources by their name. The response will only contain the resources matching the specified name + * @param labelSelector Can be used to filter resources by labels. The response will only contain resources matching the label selector. + * @param type Can be used multiple times. The response will only contain PlacementGroups matching the type. + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async placementGroupsGet (sort?: 'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc', name?: string, labelSelector?: string, type?: 'spread', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PlacementGroupsResponse; }> { + const localVarPath = this.basePath + '/placement_groups'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc'"); + } + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (labelSelector !== undefined) { + localVarQueryParameters['label_selector'] = ObjectSerializer.serialize(labelSelector, "string"); + } + + if (type !== undefined) { + localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "'spread'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: PlacementGroupsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "PlacementGroupsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Deletes a PlacementGroup. + * @summary Delete a PlacementGroup + * @param id ID of the resource + */ + public async placementGroupsIdDelete (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/placement_groups/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling placementGroupsIdDelete.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Gets a specific PlacementGroup object. + * @summary Get a PlacementGroup + * @param id ID of the resource + */ + public async placementGroupsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PlacementGroupResponse; }> { + const localVarPath = this.basePath + '/placement_groups/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling placementGroupsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: PlacementGroupResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "PlacementGroupResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Updates the PlacementGroup properties. Note that when updating labels, the PlacementGroup’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body. Note: if the PlacementGroup object changes during the request, the response will be a “conflict” error. + * @summary Update a PlacementGroup + * @param id ID of the resource + * @param updatePlacementGroupRequest + */ + public async placementGroupsIdPut (id: number, updatePlacementGroupRequest?: UpdatePlacementGroupRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PlacementGroupResponse; }> { + const localVarPath = this.basePath + '/placement_groups/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling placementGroupsIdPut.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'PUT', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(updatePlacementGroupRequest, "UpdatePlacementGroupRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: PlacementGroupResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "PlacementGroupResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Creates a new PlacementGroup. + * @summary Create a PlacementGroup + * @param createPlacementGroupRequest + */ + public async placementGroupsPost (createPlacementGroupRequest?: CreatePlacementGroupRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreatePlacementGroupResponse; }> { + const localVarPath = this.basePath + '/placement_groups'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createPlacementGroupRequest, "CreatePlacementGroupRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CreatePlacementGroupResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "CreatePlacementGroupResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/pricingApi.ts b/ts_openapi/api/pricingApi.ts new file mode 100644 index 0000000..a5e9164 --- /dev/null +++ b/ts_openapi/api/pricingApi.ts @@ -0,0 +1,160 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { PricingGet200Response } from '../model/pricingGet200Response'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum PricingApiApiKeys { +} + +export class PricingApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: PricingApiApiKeys, value: string) { + (this.authentications as any)[PricingApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns prices for all resources available on the platform. VAT and currency of the Project owner are used for calculations. Both net and gross prices are included in the response. + * @summary Get all prices + */ + public async pricingGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PricingGet200Response; }> { + const localVarPath = this.basePath + '/pricing'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: PricingGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "PricingGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/primaryIPActionsApi.ts b/ts_openapi/api/primaryIPActionsApi.ts new file mode 100644 index 0000000..8150c2c --- /dev/null +++ b/ts_openapi/api/primaryIPActionsApi.ts @@ -0,0 +1,555 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { ActionResponse } from '../model/actionResponse'; +import { ActionsResponse } from '../model/actionsResponse'; +import { AssignPrimaryIPRequest } from '../model/assignPrimaryIPRequest'; +import { ChangeDNSPTRRequest } from '../model/changeDNSPTRRequest'; +import { ChangeProtectionRequest2 } from '../model/changeProtectionRequest2'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum PrimaryIPActionsApiApiKeys { +} + +export class PrimaryIPActionsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: PrimaryIPActionsApiApiKeys, value: string) { + (this.authentications as any)[PrimaryIPActionsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Action objects. You can `sort` the results by using the sort URI parameter, and filter them with the `status` and `id` parameter. + * @summary Get all Actions + * @param id Can be used multiple times, the response will contain only Actions with specified IDs. + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async primaryIpsActionsGet (id?: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/primary_ips/actions'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (id !== undefined) { + localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action object. + * @summary Get an Action + * @param id ID of the Action. + */ + public async primaryIpsActionsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/primary_ips/actions/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling primaryIpsActionsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Assigns a Primary IP to a Server. A Server can only have one Primary IP of type `ipv4` and one of type `ipv6` assigned. If you need more IPs use Floating IPs. The Server must be powered off (status `off`) in order for this operation to succeed. #### Call specific error codes | Code | Description | |------------------------------ |-------------------------------------------------------------- | | `server_not_stopped` | The server is running, but needs to be powered off | | `primary_ip_already_assigned` | Primary ip is already assigned to a different server | | `server_has_ipv4` | The server already has an ipv4 address | | `server_has_ipv6` | The server already has an ipv6 address | + * @summary Assign a Primary IP to a resource + * @param id ID of the Primary IP + * @param assignPrimaryIPRequest + */ + public async primaryIpsIdActionsAssignPost (id: number, assignPrimaryIPRequest?: AssignPrimaryIPRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/primary_ips/{id}/actions/assign' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling primaryIpsIdActionsAssignPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(assignPrimaryIPRequest, "AssignPrimaryIPRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the hostname that will appear when getting the hostname belonging to this Primary IP. + * @summary Change reverse DNS entry for a Primary IP + * @param id ID of the Primary IP + * @param changeDNSPTRRequest Select the IP address for which to change the DNS entry by passing `ip`. For a Primary IP of type `ipv4` this must exactly match the IP address of the Primary IP. For a Primary IP of type `ipv6` this must be a single IP within the IPv6 /64 range that belongs to this Primary IP. You can add up to 100 IPv6 reverse DNS entries. The target hostname is set by passing `dns_ptr`. + */ + public async primaryIpsIdActionsChangeDnsPtrPost (id: number, changeDNSPTRRequest?: ChangeDNSPTRRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/primary_ips/{id}/actions/change_dns_ptr' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling primaryIpsIdActionsChangeDnsPtrPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(changeDNSPTRRequest, "ChangeDNSPTRRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the protection configuration of a Primary IP. A Primary IP can only be delete protected if its `auto_delete` property is set to `false`. + * @summary Change Primary IP Protection + * @param id ID of the Primary IP + * @param changeProtectionRequest2 + */ + public async primaryIpsIdActionsChangeProtectionPost (id: number, changeProtectionRequest2?: ChangeProtectionRequest2, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/primary_ips/{id}/actions/change_protection' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling primaryIpsIdActionsChangeProtectionPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(changeProtectionRequest2, "ChangeProtectionRequest2") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Unassigns a Primary IP from a Server. The Server must be powered off (status `off`) in order for this operation to succeed. Note that only Servers that have at least one network interface (public or private) attached can be powered on. #### Call specific error codes | Code | Description | |---------------------------------- |-------------------------------------------------------------- | | `server_not_stopped` | The server is running, but needs to be powered off | | `server_is_load_balancer_target` | The server ipv4 address is a loadbalancer target | + * @summary Unassign a Primary IP from a resource + * @param id ID of the Primary IP + */ + public async primaryIpsIdActionsUnassignPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/primary_ips/{id}/actions/unassign' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling primaryIpsIdActionsUnassignPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/primaryIPsApi.ts b/ts_openapi/api/primaryIPsApi.ts new file mode 100644 index 0000000..1a07917 --- /dev/null +++ b/ts_openapi/api/primaryIPsApi.ts @@ -0,0 +1,471 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { CreatePrimaryIPRequest } from '../model/createPrimaryIPRequest'; +import { CreatePrimaryIPResponse } from '../model/createPrimaryIPResponse'; +import { PrimaryIPResponse } from '../model/primaryIPResponse'; +import { PrimaryIPsResponse } from '../model/primaryIPsResponse'; +import { UpdatePrimaryIPRequest } from '../model/updatePrimaryIPRequest'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum PrimaryIPsApiApiKeys { +} + +export class PrimaryIPsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: PrimaryIPsApiApiKeys, value: string) { + (this.authentications as any)[PrimaryIPsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Primary IP objects. + * @summary Get all Primary IPs + * @param name Can be used to filter resources by their name. The response will only contain the resources matching the specified name + * @param labelSelector Can be used to filter resources by labels. The response will only contain resources matching the label selector. + * @param ip Can be used to filter resources by their ip. The response will only contain the resources matching the specified ip. + * @param page Page to load. + * @param perPage Items to load per page. + * @param sort Can be used multiple times. Choices id id:asc id:desc created created:asc created:desc + */ + public async primaryIpsGet (name?: string, labelSelector?: string, ip?: string, page?: number, perPage?: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'created' | 'created:asc' | 'created:desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PrimaryIPsResponse; }> { + const localVarPath = this.basePath + '/primary_ips'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (labelSelector !== undefined) { + localVarQueryParameters['label_selector'] = ObjectSerializer.serialize(labelSelector, "string"); + } + + if (ip !== undefined) { + localVarQueryParameters['ip'] = ObjectSerializer.serialize(ip, "string"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'created' | 'created:asc' | 'created:desc'"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: PrimaryIPsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "PrimaryIPsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Deletes a Primary IP. The Primary IP may be assigned to a Server. In this case it is unassigned automatically. The Server must be powered off (status `off`) in order for this operation to succeed. + * @summary Delete a Primary IP + * @param id ID of the resource + */ + public async primaryIpsIdDelete (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/primary_ips/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling primaryIpsIdDelete.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Primary IP object. + * @summary Get a Primary IP + * @param id ID of the resource + */ + public async primaryIpsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PrimaryIPResponse; }> { + const localVarPath = this.basePath + '/primary_ips/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling primaryIpsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: PrimaryIPResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "PrimaryIPResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Updates the Primary IP. Note that when updating labels, the Primary IP\'s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body. If the Primary IP object changes during the request, the response will be a “conflict” error. + * @summary Update a Primary IP + * @param id ID of the resource + * @param updatePrimaryIPRequest + */ + public async primaryIpsIdPut (id: number, updatePrimaryIPRequest?: UpdatePrimaryIPRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PrimaryIPResponse; }> { + const localVarPath = this.basePath + '/primary_ips/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling primaryIpsIdPut.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'PUT', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(updatePrimaryIPRequest, "UpdatePrimaryIPRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: PrimaryIPResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "PrimaryIPResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Creates a new Primary IP, optionally assigned to a Server. If you want to create a Primary IP that is not assigned to a Server, you need to provide the `datacenter` key instead of `assignee_id`. This can be either the ID or the name of the Datacenter this Primary IP shall be created in. Note that a Primary IP can only be assigned to a Server in the same Datacenter later on. #### Call specific error codes | Code | Description | |------------------------------ |-------------------------------------------------------------- | | `server_not_stopped` | The specified server is running, but needs to be powered off | | `server_has_ipv4` | The server already has an ipv4 address | | `server_has_ipv6` | The server already has an ipv6 address | + * @summary Create a Primary IP + * @param createPrimaryIPRequest The `type` argument is required while `datacenter` and `assignee_id` are mutually exclusive. + */ + public async primaryIpsPost (createPrimaryIPRequest?: CreatePrimaryIPRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreatePrimaryIPResponse; }> { + const localVarPath = this.basePath + '/primary_ips'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createPrimaryIPRequest, "CreatePrimaryIPRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CreatePrimaryIPResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "CreatePrimaryIPResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/sSHKeysApi.ts b/ts_openapi/api/sSHKeysApi.ts new file mode 100644 index 0000000..ba6bcf3 --- /dev/null +++ b/ts_openapi/api/sSHKeysApi.ts @@ -0,0 +1,470 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { SshKeysGet200Response } from '../model/sshKeysGet200Response'; +import { SshKeysIdPutRequest } from '../model/sshKeysIdPutRequest'; +import { SshKeysPost201Response } from '../model/sshKeysPost201Response'; +import { SshKeysPostRequest } from '../model/sshKeysPostRequest'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum SSHKeysApiApiKeys { +} + +export class SSHKeysApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: SSHKeysApiApiKeys, value: string) { + (this.authentications as any)[SSHKeysApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all SSH key objects. + * @summary Get all SSH keys + * @param sort Can be used multiple times. + * @param name Can be used to filter resources by their name. The response will only contain the resources matching the specified name + * @param fingerprint Can be used to filter SSH keys by their fingerprint. The response will only contain the SSH key matching the specified fingerprint. + * @param labelSelector Can be used to filter resources by labels. The response will only contain resources matching the label selector. + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async sshKeysGet (sort?: 'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc', name?: string, fingerprint?: string, labelSelector?: string, page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SshKeysGet200Response; }> { + const localVarPath = this.basePath + '/ssh_keys'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc'"); + } + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (fingerprint !== undefined) { + localVarQueryParameters['fingerprint'] = ObjectSerializer.serialize(fingerprint, "string"); + } + + if (labelSelector !== undefined) { + localVarQueryParameters['label_selector'] = ObjectSerializer.serialize(labelSelector, "string"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: SshKeysGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "SshKeysGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Deletes an SSH key. It cannot be used anymore. + * @summary Delete an SSH key + * @param id ID of the SSH key + */ + public async sshKeysIdDelete (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/ssh_keys/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling sshKeysIdDelete.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific SSH key object. + * @summary Get a SSH key + * @param id ID of the SSH key + */ + public async sshKeysIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SshKeysPost201Response; }> { + const localVarPath = this.basePath + '/ssh_keys/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling sshKeysIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: SshKeysPost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "SshKeysPost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Updates an SSH key. You can update an SSH key name and an SSH key labels. Please note that when updating labels, the SSH key current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body. + * @summary Update an SSH key + * @param id ID of the SSH key + * @param sshKeysIdPutRequest + */ + public async sshKeysIdPut (id: number, sshKeysIdPutRequest?: SshKeysIdPutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SshKeysPost201Response; }> { + const localVarPath = this.basePath + '/ssh_keys/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling sshKeysIdPut.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'PUT', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(sshKeysIdPutRequest, "SshKeysIdPutRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: SshKeysPost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "SshKeysPost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Creates a new SSH key with the given `name` and `public_key`. Once an SSH key is created, it can be used in other calls such as creating Servers. + * @summary Create an SSH key + * @param sshKeysPostRequest + */ + public async sshKeysPost (sshKeysPostRequest?: SshKeysPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SshKeysPost201Response; }> { + const localVarPath = this.basePath + '/ssh_keys'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(sshKeysPostRequest, "SshKeysPostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: SshKeysPost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "SshKeysPost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/serverActionsApi.ts b/ts_openapi/api/serverActionsApi.ts new file mode 100644 index 0000000..a7f2164 --- /dev/null +++ b/ts_openapi/api/serverActionsApi.ts @@ -0,0 +1,2122 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { ActionResponse } from '../model/actionResponse'; +import { ActionsResponse } from '../model/actionsResponse'; +import { AddToPlacementGroupRequest } from '../model/addToPlacementGroupRequest'; +import { AttachToNetworkRequest } from '../model/attachToNetworkRequest'; +import { CreateImageRequest } from '../model/createImageRequest'; +import { DetachFromNetworkRequest } from '../model/detachFromNetworkRequest'; +import { RebuildServerRequest } from '../model/rebuildServerRequest'; +import { ServersIdActionsAttachIsoPostRequest } from '../model/serversIdActionsAttachIsoPostRequest'; +import { ServersIdActionsChangeAliasIpsPostRequest } from '../model/serversIdActionsChangeAliasIpsPostRequest'; +import { ServersIdActionsChangeDnsPtrPostRequest } from '../model/serversIdActionsChangeDnsPtrPostRequest'; +import { ServersIdActionsChangeProtectionPostRequest } from '../model/serversIdActionsChangeProtectionPostRequest'; +import { ServersIdActionsChangeTypePostRequest } from '../model/serversIdActionsChangeTypePostRequest'; +import { ServersIdActionsCreateImagePost201Response } from '../model/serversIdActionsCreateImagePost201Response'; +import { ServersIdActionsEnableRescuePost201Response } from '../model/serversIdActionsEnableRescuePost201Response'; +import { ServersIdActionsEnableRescuePostRequest } from '../model/serversIdActionsEnableRescuePostRequest'; +import { ServersIdActionsRebuildPost201Response } from '../model/serversIdActionsRebuildPost201Response'; +import { ServersIdActionsRequestConsolePost201Response } from '../model/serversIdActionsRequestConsolePost201Response'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum ServerActionsApiApiKeys { +} + +export class ServerActionsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: ServerActionsApiApiKeys, value: string) { + (this.authentications as any)[ServerActionsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Action objects. You can `sort` the results by using the sort URI parameter, and filter them with the `status` and `id` parameter. + * @summary Get all Actions + * @param id Can be used multiple times, the response will contain only Actions with specified IDs. + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async serversActionsGet (id?: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/servers/actions'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (id !== undefined) { + localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action object. + * @summary Get an Action + * @param id ID of the Action. + */ + public async serversActionsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/actions/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversActionsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action object for a Server. + * @summary Get an Action for a Server + * @param id ID of the Server + * @param actionId ID of the Action + */ + public async serversIdActionsActionIdGet (id: number, actionId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/{action_id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))) + .replace('{' + 'action_id' + '}', encodeURIComponent(String(actionId))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsActionIdGet.'); + } + + // verify required parameter 'actionId' is not null or undefined + if (actionId === null || actionId === undefined) { + throw new Error('Required parameter actionId was null or undefined when calling serversIdActionsActionIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Adds a Server to a Placement Group. Server must be powered off for this command to succeed. #### Call specific error codes | Code | Description | |-------------------------------|----------------------------------------------------------------------| | `server_not_stopped` | The action requires a stopped server | + * @summary Add a Server to a Placement Group + * @param id ID of the Server + * @param addToPlacementGroupRequest + */ + public async serversIdActionsAddToPlacementGroupPost (id: number, addToPlacementGroupRequest?: AddToPlacementGroupRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/add_to_placement_group' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsAddToPlacementGroupPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(addToPlacementGroupRequest, "AddToPlacementGroupRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Attaches an ISO to a Server. The Server will immediately see it as a new disk. An already attached ISO will automatically be detached before the new ISO is attached. Servers with attached ISOs have a modified boot order: They will try to boot from the ISO first before falling back to hard disk. + * @summary Attach an ISO to a Server + * @param id ID of the Server + * @param serversIdActionsAttachIsoPostRequest + */ + public async serversIdActionsAttachIsoPost (id: number, serversIdActionsAttachIsoPostRequest?: ServersIdActionsAttachIsoPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/attach_iso' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsAttachIsoPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(serversIdActionsAttachIsoPostRequest, "ServersIdActionsAttachIsoPostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Attaches a Server to a network. This will complement the fixed public Server interface by adding an additional ethernet interface to the Server which is connected to the specified network. The Server will get an IP auto assigned from a subnet of type `server` in the same `network_zone`. Using the `alias_ips` attribute you can also define one or more additional IPs to the Servers. Please note that you will have to configure these IPs by hand on your Server since only the primary IP will be given out by DHCP. **Call specific error codes** | Code | Description | |----------------------------------|-----------------------------------------------------------------------| | `server_already_attached` | The server is already attached to the network | | `ip_not_available` | The provided Network IP is not available | | `no_subnet_available` | No Subnet or IP is available for the Server within the network | | `networks_overlap` | The network IP range overlaps with one of the server networks | + * @summary Attach a Server to a Network + * @param id ID of the Server + * @param attachToNetworkRequest + */ + public async serversIdActionsAttachToNetworkPost (id: number, attachToNetworkRequest?: AttachToNetworkRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/attach_to_network' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsAttachToNetworkPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(attachToNetworkRequest, "AttachToNetworkRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the alias IPs of an already attached Network. Note that the existing aliases for the specified Network will be replaced with these provided in the request body. So if you want to add an alias IP, you have to provide the existing ones from the Network plus the new alias IP in the request body. + * @summary Change alias IPs of a Network + * @param id ID of the Server + * @param serversIdActionsChangeAliasIpsPostRequest + */ + public async serversIdActionsChangeAliasIpsPost (id: number, serversIdActionsChangeAliasIpsPostRequest?: ServersIdActionsChangeAliasIpsPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/change_alias_ips' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsChangeAliasIpsPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(serversIdActionsChangeAliasIpsPostRequest, "ServersIdActionsChangeAliasIpsPostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the hostname that will appear when getting the hostname belonging to the primary IPs (IPv4 and IPv6) of this Server. Floating IPs assigned to the Server are not affected by this. + * @summary Change reverse DNS entry for this Server + * @param id ID of the Server + * @param serversIdActionsChangeDnsPtrPostRequest Select the IP address for which to change the DNS entry by passing `ip`. It can be either IPv4 or IPv6. The target hostname is set by passing `dns_ptr`. + */ + public async serversIdActionsChangeDnsPtrPost (id: number, serversIdActionsChangeDnsPtrPostRequest?: ServersIdActionsChangeDnsPtrPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/change_dns_ptr' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsChangeDnsPtrPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(serversIdActionsChangeDnsPtrPostRequest, "ServersIdActionsChangeDnsPtrPostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the protection configuration of the Server. + * @summary Change Server Protection + * @param id ID of the Server + * @param serversIdActionsChangeProtectionPostRequest + */ + public async serversIdActionsChangeProtectionPost (id: number, serversIdActionsChangeProtectionPostRequest?: ServersIdActionsChangeProtectionPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/change_protection' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsChangeProtectionPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(serversIdActionsChangeProtectionPostRequest, "ServersIdActionsChangeProtectionPostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the type (Cores, RAM and disk sizes) of a Server. Server must be powered off for this command to succeed. This copies the content of its disk, and starts it again. You can only migrate to Server types with the same `storage_type` and equal or bigger disks. Shrinking disks is not possible as it might destroy data. If the disk gets upgraded, the Server type can not be downgraded any more. If you plan to downgrade the Server type, set `upgrade_disk` to `false`. #### Call specific error codes | Code | Description | |-------------------------------|----------------------------------------------------------------------| | `invalid_server_type` | The server type does not fit for the given server or is deprecated | | `server_not_stopped` | The action requires a stopped server | + * @summary Change the Type of a Server + * @param id ID of the Server + * @param serversIdActionsChangeTypePostRequest + */ + public async serversIdActionsChangeTypePost (id: number, serversIdActionsChangeTypePostRequest?: ServersIdActionsChangeTypePostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/change_type' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsChangeTypePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(serversIdActionsChangeTypePostRequest, "ServersIdActionsChangeTypePostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Creates an Image (snapshot) from a Server by copying the contents of its disks. This creates a snapshot of the current state of the disk and copies it into an Image. If the Server is currently running you must make sure that its disk content is consistent. Otherwise, the created Image may not be readable. To make sure disk content is consistent, we recommend to shut down the Server prior to creating an Image. You can either create a `backup` Image that is bound to the Server and therefore will be deleted when the Server is deleted, or you can create an `snapshot` Image which is completely independent of the Server it was created from and will survive Server deletion. Backup Images are only available when the backup option is enabled for the Server. Snapshot Images are billed on a per GB basis. + * @summary Create Image from a Server + * @param id ID of the Server + * @param createImageRequest + */ + public async serversIdActionsCreateImagePost (id: number, createImageRequest?: CreateImageRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ServersIdActionsCreateImagePost201Response; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/create_image' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsCreateImagePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createImageRequest, "CreateImageRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ServersIdActionsCreateImagePost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ServersIdActionsCreateImagePost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Detaches a Server from a network. The interface for this network will vanish. + * @summary Detach a Server from a Network + * @param id ID of the Server + * @param detachFromNetworkRequest + */ + public async serversIdActionsDetachFromNetworkPost (id: number, detachFromNetworkRequest?: DetachFromNetworkRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/detach_from_network' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsDetachFromNetworkPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(detachFromNetworkRequest, "DetachFromNetworkRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Detaches an ISO from a Server. In case no ISO Image is attached to the Server, the status of the returned Action is immediately set to `success` + * @summary Detach an ISO from a Server + * @param id ID of the Server + */ + public async serversIdActionsDetachIsoPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/detach_iso' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsDetachIsoPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Disables the automatic backup option and deletes all existing Backups for a Server. No more additional charges for backups will be made. Caution: This immediately removes all existing backups for the Server! + * @summary Disable Backups for a Server + * @param id ID of the Server + */ + public async serversIdActionsDisableBackupPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/disable_backup' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsDisableBackupPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Disables the Hetzner Rescue System for a Server. This makes a Server start from its disks on next reboot. Rescue Mode is automatically disabled when you first boot into it or if you do not use it for 60 minutes. Disabling rescue mode will not reboot your Server — you will have to do this yourself. + * @summary Disable Rescue Mode for a Server + * @param id ID of the Server + */ + public async serversIdActionsDisableRescuePost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/disable_rescue' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsDisableRescuePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Enables and configures the automatic daily backup option for the Server. Enabling automatic backups will increase the price of the Server by 20%. In return, you will get seven slots where Images of type backup can be stored. Backups are automatically created daily. + * @summary Enable and Configure Backups for a Server + * @param id ID of the Server + */ + public async serversIdActionsEnableBackupPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/enable_backup' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsEnableBackupPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Enable the Hetzner Rescue System for this Server. The next time a Server with enabled rescue mode boots it will start a special minimal Linux distribution designed for repair and reinstall. In case a Server cannot boot on its own you can use this to access a Server’s disks. Rescue Mode is automatically disabled when you first boot into it or if you do not use it for 60 minutes. Enabling rescue mode will not [reboot](https://docs.hetzner.cloud/#server-actions-soft-reboot-a-server) your Server — you will have to do this yourself. + * @summary Enable Rescue Mode for a Server + * @param id ID of the Server + * @param serversIdActionsEnableRescuePostRequest + */ + public async serversIdActionsEnableRescuePost (id: number, serversIdActionsEnableRescuePostRequest?: ServersIdActionsEnableRescuePostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ServersIdActionsEnableRescuePost201Response; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/enable_rescue' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsEnableRescuePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(serversIdActionsEnableRescuePostRequest, "ServersIdActionsEnableRescuePostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ServersIdActionsEnableRescuePost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ServersIdActionsEnableRescuePost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns all Action objects for a Server. You can `sort` the results by using the sort URI parameter, and filter them with the `status` parameter. + * @summary Get all Actions for a Server + * @param id ID of the Action. + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async serversIdActionsGet (id: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsGet.'); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Cuts power to the Server. This forcefully stops it without giving the Server operating system time to gracefully stop. May lead to data loss, equivalent to pulling the power cord. Power off should only be used when shutdown does not work. + * @summary Power off a Server + * @param id ID of the Server + */ + public async serversIdActionsPoweroffPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/poweroff' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsPoweroffPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Starts a Server by turning its power on. + * @summary Power on a Server + * @param id ID of the Server + */ + public async serversIdActionsPoweronPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/poweron' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsPoweronPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Reboots a Server gracefully by sending an ACPI request. The Server operating system must support ACPI and react to the request, otherwise the Server will not reboot. + * @summary Soft-reboot a Server + * @param id ID of the Server + */ + public async serversIdActionsRebootPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/reboot' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsRebootPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Rebuilds a Server overwriting its disk with the content of an Image, thereby **destroying all data** on the target Server The Image can either be one you have created earlier (`backup` or `snapshot` Image) or it can be a completely fresh `system` Image provided by us. You can get a list of all available Images with `GET /images`. Your Server will automatically be powered off before the rebuild command executes. + * @summary Rebuild a Server from an Image + * @param id ID of the Server + * @param rebuildServerRequest To select which Image to rebuild from you can either pass an ID or a name as the `image` argument. Passing a name only works for `system` Images since the other Image types do not have a name set. + */ + public async serversIdActionsRebuildPost (id: number, rebuildServerRequest?: RebuildServerRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ServersIdActionsRebuildPost201Response; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/rebuild' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsRebuildPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(rebuildServerRequest, "RebuildServerRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ServersIdActionsRebuildPost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ServersIdActionsRebuildPost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Removes a Server from a Placement Group. + * @summary Remove from Placement Group + * @param id ID of the Server + */ + public async serversIdActionsRemoveFromPlacementGroupPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/remove_from_placement_group' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsRemoveFromPlacementGroupPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Requests credentials for remote access via VNC over websocket to keyboard, monitor, and mouse for a Server. The provided URL is valid for 1 minute, after this period a new url needs to be created to connect to the Server. How long the connection is open after the initial connect is not subject to this timeout. + * @summary Request Console for a Server + * @param id ID of the Server + */ + public async serversIdActionsRequestConsolePost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ServersIdActionsRequestConsolePost201Response; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/request_console' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsRequestConsolePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ServersIdActionsRequestConsolePost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ServersIdActionsRequestConsolePost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Resets the root password. Only works for Linux systems that are running the qemu guest agent. Server must be powered on (status `running`) in order for this operation to succeed. This will generate a new password for this Server and return it. If this does not succeed you can use the rescue system to netboot the Server and manually change your Server password by hand. + * @summary Reset root Password of a Server + * @param id ID of the Server + */ + public async serversIdActionsResetPasswordPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ServersIdActionsEnableRescuePost201Response; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/reset_password' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsResetPasswordPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ServersIdActionsEnableRescuePost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ServersIdActionsEnableRescuePost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Cuts power to a Server and starts it again. This forcefully stops it without giving the Server operating system time to gracefully stop. This may lead to data loss, it’s equivalent to pulling the power cord and plugging it in again. Reset should only be used when reboot does not work. + * @summary Reset a Server + * @param id ID of the Server + */ + public async serversIdActionsResetPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/reset' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsResetPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Shuts down a Server gracefully by sending an ACPI shutdown request. The Server operating system must support ACPI and react to the request, otherwise the Server will not shut down. Please note that the `action` status in this case only reflects whether the action was sent to the server. It does not mean that the server actually shut down successfully. If you need to ensure that the server is off, use the `poweroff` action + * @summary Shutdown a Server + * @param id ID of the Server + */ + public async serversIdActionsShutdownPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/servers/{id}/actions/shutdown' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdActionsShutdownPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/serverTypesApi.ts b/ts_openapi/api/serverTypesApi.ts new file mode 100644 index 0000000..5aae338 --- /dev/null +++ b/ts_openapi/api/serverTypesApi.ts @@ -0,0 +1,248 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { ServerTypesGet200Response } from '../model/serverTypesGet200Response'; +import { ServerTypesIdGet200Response } from '../model/serverTypesIdGet200Response'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum ServerTypesApiApiKeys { +} + +export class ServerTypesApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: ServerTypesApiApiKeys, value: string) { + (this.authentications as any)[ServerTypesApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Gets all Server type objects. + * @summary Get all Server Types + * @param name Can be used to filter Server types by their name. The response will only contain the Server type matching the specified name. + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async serverTypesGet (name?: string, page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ServerTypesGet200Response; }> { + const localVarPath = this.basePath + '/server_types'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ServerTypesGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ServerTypesGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Gets a specific Server type object. + * @summary Get a Server Type + * @param id ID of Server Type + */ + public async serverTypesIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ServerTypesIdGet200Response; }> { + const localVarPath = this.basePath + '/server_types/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serverTypesIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ServerTypesIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ServerTypesIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/serversApi.ts b/ts_openapi/api/serversApi.ts new file mode 100644 index 0000000..b2e35fd --- /dev/null +++ b/ts_openapi/api/serversApi.ts @@ -0,0 +1,588 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { CreateServerRequest } from '../model/createServerRequest'; +import { CreateServerResponse } from '../model/createServerResponse'; +import { LoadBalancersIdMetricsGet200Response } from '../model/loadBalancersIdMetricsGet200Response'; +import { ServersGet200Response } from '../model/serversGet200Response'; +import { ServersIdDelete200Response } from '../model/serversIdDelete200Response'; +import { ServersIdGet200Response } from '../model/serversIdGet200Response'; +import { UpdateServerRequest } from '../model/updateServerRequest'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum ServersApiApiKeys { +} + +export class ServersApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: ServersApiApiKeys, value: string) { + (this.authentications as any)[ServersApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all existing Server objects + * @summary Get all Servers + * @param name Can be used to filter resources by their name. The response will only contain the resources matching the specified name + * @param labelSelector Can be used to filter resources by labels. The response will only contain resources matching the label selector. + * @param sort Can be used multiple times. + * @param status Can be used multiple times. The response will only contain Server matching the status + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async serversGet (name?: string, labelSelector?: string, sort?: 'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc', status?: 'initializing' | 'starting' | 'running' | 'stopping' | 'off' | 'deleting' | 'rebuilding' | 'migrating' | 'unknown', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ServersGet200Response; }> { + const localVarPath = this.basePath + '/servers'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (labelSelector !== undefined) { + localVarQueryParameters['label_selector'] = ObjectSerializer.serialize(labelSelector, "string"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'initializing' | 'starting' | 'running' | 'stopping' | 'off' | 'deleting' | 'rebuilding' | 'migrating' | 'unknown'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ServersGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ServersGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Deletes a Server. This immediately removes the Server from your account, and it is no longer accessible. Any resources attached to the server (like Volumes, Primary IPs, Floating IPs, Firewalls, Placement Groups) are detached while the server is deleted. + * @summary Delete a Server + * @param id ID of the Server + */ + public async serversIdDelete (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ServersIdDelete200Response; }> { + const localVarPath = this.basePath + '/servers/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdDelete.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ServersIdDelete200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ServersIdDelete200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Server object. The Server must exist inside the Project + * @summary Get a Server + * @param id ID of the Server + */ + public async serversIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ServersIdGet200Response; }> { + const localVarPath = this.basePath + '/servers/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ServersIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ServersIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Get Metrics for specified Server. You must specify the type of metric to get: cpu, disk or network. You can also specify more than one type by comma separation, e.g. cpu,disk. Depending on the type you will get different time series data | Type | Timeseries | Unit | Description | |---------|-------------------------|-----------|------------------------------------------------------| | cpu | cpu | percent | Percent CPU usage | | disk | disk.0.iops.read | iop/s | Number of read IO operations per second | | | disk.0.iops.write | iop/s | Number of write IO operations per second | | | disk.0.bandwidth.read | bytes/s | Bytes read per second | | | disk.0.bandwidth.write | bytes/s | Bytes written per second | | network | network.0.pps.in | packets/s | Public Network interface packets per second received | | | network.0.pps.out | packets/s | Public Network interface packets per second sent | | | network.0.bandwidth.in | bytes/s | Public Network interface bytes/s received | | | network.0.bandwidth.out | bytes/s | Public Network interface bytes/s sent | Metrics are available for the last 30 days only. If you do not provide the step argument we will automatically adjust it so that a maximum of 200 samples are returned. We limit the number of samples returned to a maximum of 500 and will adjust the step parameter accordingly. + * @summary Get Metrics for a Server + * @param id ID of the Server + * @param type Type of metrics to get + * @param start Start of period to get Metrics for (in ISO-8601 format) + * @param end End of period to get Metrics for (in ISO-8601 format) + * @param step Resolution of results in seconds + */ + public async serversIdMetricsGet (id: number, type: 'cpu' | 'disk' | 'network', start: string, end: string, step?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LoadBalancersIdMetricsGet200Response; }> { + const localVarPath = this.basePath + '/servers/{id}/metrics' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdMetricsGet.'); + } + + // verify required parameter 'type' is not null or undefined + if (type === null || type === undefined) { + throw new Error('Required parameter type was null or undefined when calling serversIdMetricsGet.'); + } + + // verify required parameter 'start' is not null or undefined + if (start === null || start === undefined) { + throw new Error('Required parameter start was null or undefined when calling serversIdMetricsGet.'); + } + + // verify required parameter 'end' is not null or undefined + if (end === null || end === undefined) { + throw new Error('Required parameter end was null or undefined when calling serversIdMetricsGet.'); + } + + if (type !== undefined) { + localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "'cpu' | 'disk' | 'network'"); + } + + if (start !== undefined) { + localVarQueryParameters['start'] = ObjectSerializer.serialize(start, "string"); + } + + if (end !== undefined) { + localVarQueryParameters['end'] = ObjectSerializer.serialize(end, "string"); + } + + if (step !== undefined) { + localVarQueryParameters['step'] = ObjectSerializer.serialize(step, "string"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: LoadBalancersIdMetricsGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "LoadBalancersIdMetricsGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Updates a Server. You can update a Server’s name and a Server’s labels. Please note that Server names must be unique per Project and valid hostnames as per RFC 1123 (i.e. may only contain letters, digits, periods, and dashes). Also note that when updating labels, the Server’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body. + * @summary Update a Server + * @param id ID of the Server + * @param updateServerRequest + */ + public async serversIdPut (id: number, updateServerRequest?: UpdateServerRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ServersIdGet200Response; }> { + const localVarPath = this.basePath + '/servers/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling serversIdPut.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'PUT', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(updateServerRequest, "UpdateServerRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ServersIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ServersIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Creates a new Server. Returns preliminary information about the Server as well as an Action that covers progress of creation. + * @summary Create a Server + * @param createServerRequest Please note that Server names must be unique per Project and valid hostnames as per RFC 1123 (i.e. may only contain letters, digits, periods, and dashes). For `server_type` you can either use the ID as listed in `/server_types` or its name. For `image` you can either use the ID as listed in `/images` or its name. If you want to create the Server in a Location, you must set `location` to the ID or name as listed in `/locations`. This is the recommended way. You can be even more specific by setting `datacenter` to the ID or name as listed in `/datacenters`. However we only recommend this if you want to assign a specific Primary IP to the Server which is located in the specified Datacenter. Some properties like `start_after_create` or `automount` will trigger Actions after the Server is created. Those Actions are listed in the `next_actions` field in the response. For accessing your Server we strongly recommend to use SSH keys by passing the respective key IDs in `ssh_keys`. If you do not specify any `ssh_keys` we will generate a root password for you and return it in the response. Please note that provided user-data is stored in our systems. While we take measures to protect it we highly recommend that you don’t use it to store passwords or other sensitive information. #### Call specific error codes | Code | Description | |----------------------------------|------------------------------------------------------------| | `placement_error` | An error during the placement occurred | | `primary_ip_assigned` | The specified Primary IP is already assigned to a server | | `primary_ip_datacenter_mismatch` | The specified Primary IP is in a different datacenter | | `primary_ip_version_mismatch` | The specified Primary IP has the wrong IP Version | + */ + public async serversPost (createServerRequest?: CreateServerRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateServerResponse; }> { + const localVarPath = this.basePath + '/servers'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createServerRequest, "CreateServerRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: CreateServerResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "CreateServerResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/volumeActionsApi.ts b/ts_openapi/api/volumeActionsApi.ts new file mode 100644 index 0000000..e1ff501 --- /dev/null +++ b/ts_openapi/api/volumeActionsApi.ts @@ -0,0 +1,726 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { ActionResponse } from '../model/actionResponse'; +import { ActionsResponse } from '../model/actionsResponse'; +import { AttachVolumeRequest } from '../model/attachVolumeRequest'; +import { VolumesIdActionsChangeProtectionPostRequest } from '../model/volumesIdActionsChangeProtectionPostRequest'; +import { VolumesIdActionsResizePostRequest } from '../model/volumesIdActionsResizePostRequest'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum VolumeActionsApiApiKeys { +} + +export class VolumeActionsApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: VolumeActionsApiApiKeys, value: string) { + (this.authentications as any)[VolumeActionsApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Returns all Action objects. You can `sort` the results by using the sort URI parameter, and filter them with the `status` and `id` parameter. + * @summary Get all Actions + * @param id Can be used multiple times, the response will contain only Actions with specified IDs. + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async volumesActionsGet (id?: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/volumes/actions'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (id !== undefined) { + localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "number"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action object. + * @summary Get an Action + * @param id ID of the Action. + */ + public async volumesActionsIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/volumes/actions/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling volumesActionsIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns a specific Action for a Volume. + * @summary Get an Action for a Volume + * @param id ID of the Volume + * @param actionId ID of the Action + */ + public async volumesIdActionsActionIdGet (id: number, actionId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/volumes/{id}/actions/{action_id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))) + .replace('{' + 'action_id' + '}', encodeURIComponent(String(actionId))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling volumesIdActionsActionIdGet.'); + } + + // verify required parameter 'actionId' is not null or undefined + if (actionId === null || actionId === undefined) { + throw new Error('Required parameter actionId was null or undefined when calling volumesIdActionsActionIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Attaches a Volume to a Server. Works only if the Server is in the same Location as the Volume. + * @summary Attach Volume to a Server + * @param id ID of the Volume + * @param attachVolumeRequest + */ + public async volumesIdActionsAttachPost (id: number, attachVolumeRequest?: AttachVolumeRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/volumes/{id}/actions/attach' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling volumesIdActionsAttachPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(attachVolumeRequest, "AttachVolumeRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the protection configuration of a Volume. + * @summary Change Volume Protection + * @param id ID of the Volume + * @param volumesIdActionsChangeProtectionPostRequest + */ + public async volumesIdActionsChangeProtectionPost (id: number, volumesIdActionsChangeProtectionPostRequest?: VolumesIdActionsChangeProtectionPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/volumes/{id}/actions/change_protection' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling volumesIdActionsChangeProtectionPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(volumesIdActionsChangeProtectionPostRequest, "VolumesIdActionsChangeProtectionPostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Detaches a Volume from the Server it’s attached to. You may attach it to a Server again at a later time. + * @summary Detach Volume + * @param id ID of the Volume + */ + public async volumesIdActionsDetachPost (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/volumes/{id}/actions/detach' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling volumesIdActionsDetachPost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Returns all Action objects for a Volume. You can `sort` the results by using the sort URI parameter, and filter them with the `status` parameter. + * @summary Get all Actions for a Volume + * @param id ID of the Volume + * @param sort Can be used multiple times. + * @param status Can be used multiple times, the response will contain only Actions with specified statuses + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async volumesIdActionsGet (id: number, sort?: 'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc', status?: 'running' | 'success' | 'error', page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionsResponse; }> { + const localVarPath = this.basePath + '/volumes/{id}/actions' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling volumesIdActionsGet.'); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'command' | 'command:asc' | 'command:desc' | 'status' | 'status:asc' | 'status:desc' | 'started' | 'started:asc' | 'started:desc' | 'finished' | 'finished:asc' | 'finished:desc'"); + } + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'running' | 'success' | 'error'"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionsResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionsResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Changes the size of a Volume. Note that downsizing a Volume is not possible. + * @summary Resize Volume + * @param id ID of the Volume + * @param volumesIdActionsResizePostRequest + */ + public async volumesIdActionsResizePost (id: number, volumesIdActionsResizePostRequest?: VolumesIdActionsResizePostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ActionResponse; }> { + const localVarPath = this.basePath + '/volumes/{id}/actions/resize' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling volumesIdActionsResizePost.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(volumesIdActionsResizePostRequest, "VolumesIdActionsResizePostRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: ActionResponse; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ActionResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/api/volumesApi.ts b/ts_openapi/api/volumesApi.ts new file mode 100644 index 0000000..5f30598 --- /dev/null +++ b/ts_openapi/api/volumesApi.ts @@ -0,0 +1,471 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import localVarRequest from 'request'; +import http from 'http'; + +/* tslint:disable:no-unused-locals */ +import { CreateVolumeRequest } from '../model/createVolumeRequest'; +import { UpdateVolumeRequest } from '../model/updateVolumeRequest'; +import { VolumesGet200Response } from '../model/volumesGet200Response'; +import { VolumesIdGet200Response } from '../model/volumesIdGet200Response'; +import { VolumesPost201Response } from '../model/volumesPost201Response'; + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; + +import { HttpError, RequestFile } from './apis'; + +let defaultBasePath = 'https://api.hetzner.cloud/v1'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum VolumesApiApiKeys { +} + +export class VolumesApi { + protected _basePath = defaultBasePath; + protected _defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + 'APIToken': new HttpBearerAuth(), + } + + protected interceptors: Interceptor[] = []; + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + set defaultHeaders(defaultHeaders: any) { + this._defaultHeaders = defaultHeaders; + } + + get defaultHeaders() { + return this._defaultHeaders; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: VolumesApiApiKeys, value: string) { + (this.authentications as any)[VolumesApiApiKeys[key]].apiKey = value; + } + + set accessToken(accessToken: string | (() => string)) { + this.authentications.APIToken.accessToken = accessToken; + } + + public addInterceptor(interceptor: Interceptor) { + this.interceptors.push(interceptor); + } + + /** + * Gets all existing Volumes that you have available. + * @summary Get all Volumes + * @param status Can be used multiple times. The response will only contain Volumes matching the status. + * @param sort Can be used multiple times. + * @param name Can be used to filter resources by their name. The response will only contain the resources matching the specified name + * @param labelSelector Can be used to filter resources by labels. The response will only contain resources matching the label selector. + * @param page Page to load. + * @param perPage Items to load per page. + */ + public async volumesGet (status?: 'available' | 'creating', sort?: 'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc', name?: string, labelSelector?: string, page?: number, perPage?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: VolumesGet200Response; }> { + const localVarPath = this.basePath + '/volumes'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + if (status !== undefined) { + localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'available' | 'creating'"); + } + + if (sort !== undefined) { + localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'id' | 'id:asc' | 'id:desc' | 'name' | 'name:asc' | 'name:desc' | 'created' | 'created:asc' | 'created:desc'"); + } + + if (name !== undefined) { + localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); + } + + if (labelSelector !== undefined) { + localVarQueryParameters['label_selector'] = ObjectSerializer.serialize(labelSelector, "string"); + } + + if (page !== undefined) { + localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); + } + + if (perPage !== undefined) { + localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number"); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: VolumesGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "VolumesGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Deletes a volume. All Volume data is irreversibly destroyed. The Volume must not be attached to a Server and it must not have delete protection enabled. + * @summary Delete a Volume + * @param id ID of the Volume + */ + public async volumesIdDelete (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + const localVarPath = this.basePath + '/volumes/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling volumesIdDelete.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'DELETE', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Gets a specific Volume object. + * @summary Get a Volume + * @param id ID of the Volume + */ + public async volumesIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: VolumesIdGet200Response; }> { + const localVarPath = this.basePath + '/volumes/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling volumesIdGet.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: VolumesIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "VolumesIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Updates the Volume properties. Note that when updating labels, the volume’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body. + * @summary Update a Volume + * @param id ID of the Volume to update + * @param updateVolumeRequest + */ + public async volumesIdPut (id: number, updateVolumeRequest?: UpdateVolumeRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: VolumesIdGet200Response; }> { + const localVarPath = this.basePath + '/volumes/{id}' + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling volumesIdPut.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'PUT', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(updateVolumeRequest, "UpdateVolumeRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: VolumesIdGet200Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "VolumesIdGet200Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } + /** + * Creates a new Volume attached to a Server. If you want to create a Volume that is not attached to a Server, you need to provide the `location` key instead of `server`. This can be either the ID or the name of the Location this Volume will be created in. Note that a Volume can be attached to a Server only in the same Location as the Volume itself. Specifying the Server during Volume creation will automatically attach the Volume to that Server after it has been initialized. In that case, the `next_actions` key in the response is an array which contains a single `attach_volume` action. The minimum Volume size is 10GB and the maximum size is 10TB (10240GB). A volume’s name can consist of alphanumeric characters, dashes, underscores, and dots, but has to start and end with an alphanumeric character. The total length is limited to 64 characters. Volume names must be unique per Project. #### Call specific error codes | Code | Description | |-------------------------------------|-----------------------------------------------------| | `no_space_left_in_location` | There is no volume space left in the given location | + * @summary Create a Volume + * @param createVolumeRequest + */ + public async volumesPost (createVolumeRequest?: CreateVolumeRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: VolumesPost201Response; }> { + const localVarPath = this.basePath + '/volumes'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(createVolumeRequest, "CreateVolumeRequest") + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.APIToken.accessToken) { + authenticationPromise = authenticationPromise.then(() => this.authentications.APIToken.applyToRequest(localVarRequestOptions)); + } + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: VolumesPost201Response; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "VolumesPost201Response"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } +} diff --git a/ts_openapi/git_push.sh b/ts_openapi/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/ts_openapi/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/ts_openapi/model/action.ts b/ts_openapi/model/action.ts new file mode 100644 index 0000000..2590cfb --- /dev/null +++ b/ts_openapi/model/action.ts @@ -0,0 +1,103 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionError } from './actionError'; +import { ActionResourcesInner } from './actionResourcesInner'; + +export class Action { + /** + * Command executed in the Action + */ + 'command': string; + 'error': ActionError | null; + /** + * Point in time when the Action was finished (in ISO-8601 format). Only set if the Action is finished otherwise null. + */ + 'finished': string | null; + /** + * ID of the Action. Limited to 52 bits to ensure compatability with JSON double precision floats. + */ + 'id': number; + /** + * Progress of Action in percent + */ + 'progress': number; + /** + * Resources the Action relates to + */ + 'resources': Array; + /** + * Point in time when the Action was started (in ISO-8601 format) + */ + 'started': string; + /** + * Status of the Action + */ + 'status': Action.StatusEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "command", + "baseName": "command", + "type": "string" + }, + { + "name": "error", + "baseName": "error", + "type": "ActionError" + }, + { + "name": "finished", + "baseName": "finished", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "progress", + "baseName": "progress", + "type": "number" + }, + { + "name": "resources", + "baseName": "resources", + "type": "Array" + }, + { + "name": "started", + "baseName": "started", + "type": "string" + }, + { + "name": "status", + "baseName": "status", + "type": "Action.StatusEnum" + } ]; + + static getAttributeTypeMap() { + return Action.attributeTypeMap; + } +} + +export namespace Action { + export enum StatusEnum { + Success = 'success', + Running = 'running', + Error = 'error' + } +} diff --git a/ts_openapi/model/actionError.ts b/ts_openapi/model/actionError.ts new file mode 100644 index 0000000..1bb784f --- /dev/null +++ b/ts_openapi/model/actionError.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Error message for the Action if error occurred, otherwise null +*/ +export class ActionError { + /** + * Fixed machine readable code + */ + 'code': string; + /** + * Humanized error message + */ + 'message': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string" + }, + { + "name": "message", + "baseName": "message", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ActionError.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/actionResourcesInner.ts b/ts_openapi/model/actionResourcesInner.ts new file mode 100644 index 0000000..30d22cb --- /dev/null +++ b/ts_openapi/model/actionResourcesInner.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ActionResourcesInner { + /** + * ID of the Resource + */ + 'id': number; + /** + * Type of resource referenced + */ + 'type': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ActionResourcesInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/actionResponse.ts b/ts_openapi/model/actionResponse.ts new file mode 100644 index 0000000..4141e9f --- /dev/null +++ b/ts_openapi/model/actionResponse.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; + +export class ActionResponse { + 'action': Action; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "action", + "baseName": "action", + "type": "Action" + } ]; + + static getAttributeTypeMap() { + return ActionResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/actionsResponse.ts b/ts_openapi/model/actionsResponse.ts new file mode 100644 index 0000000..f1c7be2 --- /dev/null +++ b/ts_openapi/model/actionsResponse.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; +import { ActionsResponseMeta } from './actionsResponseMeta'; + +export class ActionsResponse { + 'actions': Array; + 'meta'?: ActionsResponseMeta; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "actions", + "baseName": "actions", + "type": "Array" + }, + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + } ]; + + static getAttributeTypeMap() { + return ActionsResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/actionsResponseMeta.ts b/ts_openapi/model/actionsResponseMeta.ts new file mode 100644 index 0000000..f8cce7d --- /dev/null +++ b/ts_openapi/model/actionsResponseMeta.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMetaPagination } from './actionsResponseMetaPagination'; + +export class ActionsResponseMeta { + 'pagination': ActionsResponseMetaPagination; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "pagination", + "baseName": "pagination", + "type": "ActionsResponseMetaPagination" + } ]; + + static getAttributeTypeMap() { + return ActionsResponseMeta.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/actionsResponseMetaPagination.ts b/ts_openapi/model/actionsResponseMetaPagination.ts new file mode 100644 index 0000000..9ac979d --- /dev/null +++ b/ts_openapi/model/actionsResponseMetaPagination.ts @@ -0,0 +1,79 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ActionsResponseMetaPagination { + /** + * ID of the last page available. Can be null if the current page is the last one. + */ + 'lastPage': number | null; + /** + * ID of the next page. Can be null if the current page is the last one. + */ + 'nextPage': number | null; + /** + * Current page number + */ + 'page': number; + /** + * Maximum number of items shown per page in the response + */ + 'perPage': number; + /** + * ID of the previous page. Can be null if the current page is the first one. + */ + 'previousPage': number | null; + /** + * The total number of entries that exist in the database for this query. Nullable if unknown. + */ + 'totalEntries': number | null; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "lastPage", + "baseName": "last_page", + "type": "number" + }, + { + "name": "nextPage", + "baseName": "next_page", + "type": "number" + }, + { + "name": "page", + "baseName": "page", + "type": "number" + }, + { + "name": "perPage", + "baseName": "per_page", + "type": "number" + }, + { + "name": "previousPage", + "baseName": "previous_page", + "type": "number" + }, + { + "name": "totalEntries", + "baseName": "total_entries", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return ActionsResponseMetaPagination.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/addDeleteRouteRequest.ts b/ts_openapi/model/addDeleteRouteRequest.ts new file mode 100644 index 0000000..abffd5a --- /dev/null +++ b/ts_openapi/model/addDeleteRouteRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class AddDeleteRouteRequest { + /** + * Destination network or host of this route. Must not overlap with an existing ip_range in any subnets or with any destinations in other routes or with the first IP of the networks ip_range or with 172.31.1.1. Must be one of the private IPv4 ranges of RFC1918. + */ + 'destination': string; + /** + * Gateway for the route. Cannot be the first IP of the networks ip_range, an IP behind a vSwitch or 172.31.1.1, as this IP is being used as a gateway for the public network interface of Servers. + */ + 'gateway': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "destination", + "baseName": "destination", + "type": "string" + }, + { + "name": "gateway", + "baseName": "gateway", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return AddDeleteRouteRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/addSubnetRequest.ts b/ts_openapi/model/addSubnetRequest.ts new file mode 100644 index 0000000..9d5947f --- /dev/null +++ b/ts_openapi/model/addSubnetRequest.ts @@ -0,0 +1,68 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class AddSubnetRequest { + /** + * Range to allocate IPs from. Must be a Subnet of the ip_range of the parent network object and must not overlap with any other subnets or with any destinations in routes. If the Subnet is of type vSwitch, it also can not overlap with any gateway in routes. Minimum Network size is /30. We suggest that you pick a bigger Network with a /24 netmask. + */ + 'ipRange'?: string; + /** + * Name of Network zone. The Location object contains the `network_zone` property each Location belongs to. + */ + 'networkZone': string; + /** + * Type of Subnetwork + */ + 'type': AddSubnetRequest.TypeEnum; + /** + * ID of the robot vSwitch. Must be supplied if the subnet is of type vswitch. + */ + 'vswitchId'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "ipRange", + "baseName": "ip_range", + "type": "string" + }, + { + "name": "networkZone", + "baseName": "network_zone", + "type": "string" + }, + { + "name": "type", + "baseName": "type", + "type": "AddSubnetRequest.TypeEnum" + }, + { + "name": "vswitchId", + "baseName": "vswitch_id", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return AddSubnetRequest.attributeTypeMap; + } +} + +export namespace AddSubnetRequest { + export enum TypeEnum { + Cloud = 'cloud', + Server = 'server', + Vswitch = 'vswitch' + } +} diff --git a/ts_openapi/model/addTargetRequest.ts b/ts_openapi/model/addTargetRequest.ts new file mode 100644 index 0000000..fb7afd9 --- /dev/null +++ b/ts_openapi/model/addTargetRequest.ts @@ -0,0 +1,71 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { AddTargetRequestLabelSelector } from './addTargetRequestLabelSelector'; +import { AddTargetRequestServer } from './addTargetRequestServer'; +import { LoadBalancerTargetIP } from './loadBalancerTargetIP'; + +export class AddTargetRequest { + 'ip'?: LoadBalancerTargetIP; + 'labelSelector'?: AddTargetRequestLabelSelector; + 'server'?: AddTargetRequestServer; + /** + * Type of the resource + */ + 'type': AddTargetRequest.TypeEnum; + /** + * Use the private network IP instead of the public IP of the Server, requires the Server and Load Balancer to be in the same network. + */ + 'usePrivateIp'?: boolean = false; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "ip", + "baseName": "ip", + "type": "LoadBalancerTargetIP" + }, + { + "name": "labelSelector", + "baseName": "label_selector", + "type": "AddTargetRequestLabelSelector" + }, + { + "name": "server", + "baseName": "server", + "type": "AddTargetRequestServer" + }, + { + "name": "type", + "baseName": "type", + "type": "AddTargetRequest.TypeEnum" + }, + { + "name": "usePrivateIp", + "baseName": "use_private_ip", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return AddTargetRequest.attributeTypeMap; + } +} + +export namespace AddTargetRequest { + export enum TypeEnum { + Server = 'server', + LabelSelector = 'label_selector', + Ip = 'ip' + } +} diff --git a/ts_openapi/model/addTargetRequestLabelSelector.ts b/ts_openapi/model/addTargetRequestLabelSelector.ts new file mode 100644 index 0000000..d442e8f --- /dev/null +++ b/ts_openapi/model/addTargetRequestLabelSelector.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Configuration for label selector targets, required if type is `label_selector` +*/ +export class AddTargetRequestLabelSelector { + /** + * Label selector + */ + 'selector': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "selector", + "baseName": "selector", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return AddTargetRequestLabelSelector.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/addTargetRequestServer.ts b/ts_openapi/model/addTargetRequestServer.ts new file mode 100644 index 0000000..ad48803 --- /dev/null +++ b/ts_openapi/model/addTargetRequestServer.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Configuration for type Server, required if type is `server` +*/ +export class AddTargetRequestServer { + /** + * ID of the Server + */ + 'id': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return AddTargetRequestServer.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/addToPlacementGroupRequest.ts b/ts_openapi/model/addToPlacementGroupRequest.ts new file mode 100644 index 0000000..5d283a6 --- /dev/null +++ b/ts_openapi/model/addToPlacementGroupRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class AddToPlacementGroupRequest { + /** + * ID of Placement Group the Server should be added to + */ + 'placementGroup': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "placementGroup", + "baseName": "placement_group", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return AddToPlacementGroupRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/applyToResourcesRequest.ts b/ts_openapi/model/applyToResourcesRequest.ts new file mode 100644 index 0000000..6b99524 --- /dev/null +++ b/ts_openapi/model/applyToResourcesRequest.ts @@ -0,0 +1,35 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FirewallApplyToResources } from './firewallApplyToResources'; + +export class ApplyToResourcesRequest { + /** + * Resources the Firewall should be applied to + */ + 'applyTo': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "applyTo", + "baseName": "apply_to", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return ApplyToResourcesRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/assignFloatingIPRequest.ts b/ts_openapi/model/assignFloatingIPRequest.ts new file mode 100644 index 0000000..a39d0df --- /dev/null +++ b/ts_openapi/model/assignFloatingIPRequest.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* #### Call specific error codes | Code | Description | |------------------------------ |-------------------------------------------------------------- | | `floating_ip_assigned` | The floating IP is already assigned | +*/ +export class AssignFloatingIPRequest { + /** + * ID of the Server the Floating IP shall be assigned to + */ + 'server': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "server", + "baseName": "server", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return AssignFloatingIPRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/assignPrimaryIPRequest.ts b/ts_openapi/model/assignPrimaryIPRequest.ts new file mode 100644 index 0000000..80d71ca --- /dev/null +++ b/ts_openapi/model/assignPrimaryIPRequest.ts @@ -0,0 +1,48 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class AssignPrimaryIPRequest { + /** + * ID of a resource of type `assignee_type` + */ + 'assigneeId': number; + /** + * Type of resource assigning the Primary IP to + */ + 'assigneeType': AssignPrimaryIPRequest.AssigneeTypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "assigneeId", + "baseName": "assignee_id", + "type": "number" + }, + { + "name": "assigneeType", + "baseName": "assignee_type", + "type": "AssignPrimaryIPRequest.AssigneeTypeEnum" + } ]; + + static getAttributeTypeMap() { + return AssignPrimaryIPRequest.attributeTypeMap; + } +} + +export namespace AssignPrimaryIPRequest { + export enum AssigneeTypeEnum { + Server = 'server' + } +} diff --git a/ts_openapi/model/attachToNetworkRequest.ts b/ts_openapi/model/attachToNetworkRequest.ts new file mode 100644 index 0000000..6a728f3 --- /dev/null +++ b/ts_openapi/model/attachToNetworkRequest.ts @@ -0,0 +1,52 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class AttachToNetworkRequest { + /** + * Additional IPs to be assigned to this Server + */ + 'aliasIps'?: Array; + /** + * IP to request to be assigned to this Server; if you do not provide this then you will be auto assigned an IP address + */ + 'ip'?: string; + /** + * ID of an existing network to attach the Server to + */ + 'network': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "aliasIps", + "baseName": "alias_ips", + "type": "Array" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + }, + { + "name": "network", + "baseName": "network", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return AttachToNetworkRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/attachVolumeRequest.ts b/ts_openapi/model/attachVolumeRequest.ts new file mode 100644 index 0000000..364eaeb --- /dev/null +++ b/ts_openapi/model/attachVolumeRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class AttachVolumeRequest { + /** + * Auto-mount the Volume after attaching it + */ + 'automount'?: boolean; + /** + * ID of the Server the Volume will be attached to + */ + 'server': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "automount", + "baseName": "automount", + "type": "boolean" + }, + { + "name": "server", + "baseName": "server", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return AttachVolumeRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/certificate.ts b/ts_openapi/model/certificate.ts new file mode 100644 index 0000000..7bfa90f --- /dev/null +++ b/ts_openapi/model/certificate.ts @@ -0,0 +1,138 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { CertificateStatus } from './certificateStatus'; +import { CertificateUsedByInner } from './certificateUsedByInner'; + +export class Certificate { + /** + * Certificate and chain in PEM format, in order so that each record directly certifies the one preceding + */ + 'certificate': string | null; + /** + * Point in time when the Resource was created (in ISO-8601 format) + */ + 'created': string; + /** + * Domains and subdomains covered by the Certificate + */ + 'domainNames': Array; + /** + * SHA256 fingerprint of the Certificate + */ + 'fingerprint': string | null; + /** + * ID of the Resource + */ + 'id': number; + /** + * User-defined labels (key-value pairs) + */ + 'labels': { [key: string]: string; }; + /** + * Name of the Resource. Must be unique per Project. + */ + 'name': string; + /** + * Point in time when the Certificate stops being valid (in ISO-8601 format) + */ + 'notValidAfter': string | null; + /** + * Point in time when the Certificate becomes valid (in ISO-8601 format) + */ + 'notValidBefore': string | null; + 'status'?: CertificateStatus | null; + /** + * Type of the Certificate + */ + 'type'?: Certificate.TypeEnum; + /** + * Resources currently using the Certificate + */ + 'usedBy': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "certificate", + "baseName": "certificate", + "type": "string" + }, + { + "name": "created", + "baseName": "created", + "type": "string" + }, + { + "name": "domainNames", + "baseName": "domain_names", + "type": "Array" + }, + { + "name": "fingerprint", + "baseName": "fingerprint", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "labels", + "baseName": "labels", + "type": "{ [key: string]: string; }" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "notValidAfter", + "baseName": "not_valid_after", + "type": "string" + }, + { + "name": "notValidBefore", + "baseName": "not_valid_before", + "type": "string" + }, + { + "name": "status", + "baseName": "status", + "type": "CertificateStatus" + }, + { + "name": "type", + "baseName": "type", + "type": "Certificate.TypeEnum" + }, + { + "name": "usedBy", + "baseName": "used_by", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return Certificate.attributeTypeMap; + } +} + +export namespace Certificate { + export enum TypeEnum { + Uploaded = 'uploaded', + Managed = 'managed' + } +} diff --git a/ts_openapi/model/certificateResponse.ts b/ts_openapi/model/certificateResponse.ts new file mode 100644 index 0000000..cf0ff17 --- /dev/null +++ b/ts_openapi/model/certificateResponse.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Certificate } from './certificate'; + +export class CertificateResponse { + 'certificate': Certificate; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "certificate", + "baseName": "certificate", + "type": "Certificate" + } ]; + + static getAttributeTypeMap() { + return CertificateResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/certificateStatus.ts b/ts_openapi/model/certificateStatus.ts new file mode 100644 index 0000000..1700c46 --- /dev/null +++ b/ts_openapi/model/certificateStatus.ts @@ -0,0 +1,66 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { CertificateStatusError } from './certificateStatusError'; + +/** +* Current status of a type `managed` Certificate, always *null* for type `uploaded` Certificates +*/ +export class CertificateStatus { + 'error'?: CertificateStatusError | null; + /** + * Status of the issuance process of the Certificate + */ + 'issuance'?: CertificateStatus.IssuanceEnum; + /** + * Status of the renewal process of the Certificate. + */ + 'renewal'?: CertificateStatus.RenewalEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "error", + "baseName": "error", + "type": "CertificateStatusError" + }, + { + "name": "issuance", + "baseName": "issuance", + "type": "CertificateStatus.IssuanceEnum" + }, + { + "name": "renewal", + "baseName": "renewal", + "type": "CertificateStatus.RenewalEnum" + } ]; + + static getAttributeTypeMap() { + return CertificateStatus.attributeTypeMap; + } +} + +export namespace CertificateStatus { + export enum IssuanceEnum { + Pending = 'pending', + Completed = 'completed', + Failed = 'failed' + } + export enum RenewalEnum { + Scheduled = 'scheduled', + Pending = 'pending', + Failed = 'failed', + Unavailable = 'unavailable' + } +} diff --git a/ts_openapi/model/certificateStatusError.ts b/ts_openapi/model/certificateStatusError.ts new file mode 100644 index 0000000..f2105cc --- /dev/null +++ b/ts_openapi/model/certificateStatusError.ts @@ -0,0 +1,40 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* If issuance or renewal reports `failed`, this property contains information about what happened +*/ +export class CertificateStatusError { + 'code'?: string; + 'message'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string" + }, + { + "name": "message", + "baseName": "message", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return CertificateStatusError.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/certificateUsedByInner.ts b/ts_openapi/model/certificateUsedByInner.ts new file mode 100644 index 0000000..9ddb06b --- /dev/null +++ b/ts_openapi/model/certificateUsedByInner.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class CertificateUsedByInner { + /** + * ID of resource referenced + */ + 'id': number; + /** + * Type of resource referenced + */ + 'type': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return CertificateUsedByInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/certificatesResponse.ts b/ts_openapi/model/certificatesResponse.ts new file mode 100644 index 0000000..0c21887 --- /dev/null +++ b/ts_openapi/model/certificatesResponse.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { Certificate } from './certificate'; + +export class CertificatesResponse { + 'certificates': Array; + 'meta'?: ActionsResponseMeta; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "certificates", + "baseName": "certificates", + "type": "Array" + }, + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + } ]; + + static getAttributeTypeMap() { + return CertificatesResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/changeDNSPTRRequest.ts b/ts_openapi/model/changeDNSPTRRequest.ts new file mode 100644 index 0000000..2eafeae --- /dev/null +++ b/ts_openapi/model/changeDNSPTRRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ChangeDNSPTRRequest { + /** + * Hostname to set as a reverse DNS PTR entry, will reset to original default value if `null` + */ + 'dnsPtr': string | null; + /** + * IP address for which to set the reverse DNS entry + */ + 'ip': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "dnsPtr", + "baseName": "dns_ptr", + "type": "string" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ChangeDNSPTRRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/changeIPRangeRequest.ts b/ts_openapi/model/changeIPRangeRequest.ts new file mode 100644 index 0000000..0b99c5f --- /dev/null +++ b/ts_openapi/model/changeIPRangeRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ChangeIPRangeRequest { + /** + * The new prefix for the whole Network + */ + 'ipRange': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "ipRange", + "baseName": "ip_range", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ChangeIPRangeRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/changeLoadbalancerDnsPtrRequest.ts b/ts_openapi/model/changeLoadbalancerDnsPtrRequest.ts new file mode 100644 index 0000000..95ac405 --- /dev/null +++ b/ts_openapi/model/changeLoadbalancerDnsPtrRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ChangeLoadbalancerDnsPtrRequest { + /** + * Hostname to set as a reverse DNS PTR entry + */ + 'dnsPtr': string | null; + /** + * Public IP address for which the reverse DNS entry should be set + */ + 'ip': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "dnsPtr", + "baseName": "dns_ptr", + "type": "string" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ChangeLoadbalancerDnsPtrRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/changeProtectionRequest.ts b/ts_openapi/model/changeProtectionRequest.ts new file mode 100644 index 0000000..1a54888 --- /dev/null +++ b/ts_openapi/model/changeProtectionRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ChangeProtectionRequest { + /** + * If true, prevents the Floating IP from being deleted + */ + '_delete'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "_delete", + "baseName": "delete", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return ChangeProtectionRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/changeProtectionRequest1.ts b/ts_openapi/model/changeProtectionRequest1.ts new file mode 100644 index 0000000..9f85f9f --- /dev/null +++ b/ts_openapi/model/changeProtectionRequest1.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ChangeProtectionRequest1 { + /** + * If true, prevents the Network from being deleted + */ + '_delete'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "_delete", + "baseName": "delete", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return ChangeProtectionRequest1.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/changeProtectionRequest2.ts b/ts_openapi/model/changeProtectionRequest2.ts new file mode 100644 index 0000000..dcdc7f3 --- /dev/null +++ b/ts_openapi/model/changeProtectionRequest2.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ChangeProtectionRequest2 { + /** + * If true, prevents the Primary IP from being deleted + */ + '_delete'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "_delete", + "baseName": "delete", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return ChangeProtectionRequest2.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/changeTypeRequest.ts b/ts_openapi/model/changeTypeRequest.ts new file mode 100644 index 0000000..c30c67f --- /dev/null +++ b/ts_openapi/model/changeTypeRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ChangeTypeRequest { + /** + * ID or name of Load Balancer type the Load Balancer should migrate to + */ + 'loadBalancerType': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "loadBalancerType", + "baseName": "load_balancer_type", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ChangeTypeRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createCertificateRequest.ts b/ts_openapi/model/createCertificateRequest.ts new file mode 100644 index 0000000..153aa95 --- /dev/null +++ b/ts_openapi/model/createCertificateRequest.ts @@ -0,0 +1,85 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class CreateCertificateRequest { + /** + * Certificate and chain in PEM format, in order so that each record directly certifies the one preceding. Required for type `uploaded` Certificates. + */ + 'certificate'?: string; + /** + * Domains and subdomains that should be contained in the Certificate issued by *Let\'s Encrypt*. Required for type `managed` Certificates. + */ + 'domainNames'?: Array; + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * Name of the Certificate + */ + 'name': string; + /** + * Certificate key in PEM format. Required for type `uploaded` Certificates. + */ + 'privateKey'?: string; + /** + * Choose between uploading a Certificate in PEM format or requesting a managed *Let\'s Encrypt* Certificate. + */ + 'type'?: CreateCertificateRequest.TypeEnum = CreateCertificateRequest.TypeEnum.Uploaded; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "certificate", + "baseName": "certificate", + "type": "string" + }, + { + "name": "domainNames", + "baseName": "domain_names", + "type": "Array" + }, + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "privateKey", + "baseName": "private_key", + "type": "string" + }, + { + "name": "type", + "baseName": "type", + "type": "CreateCertificateRequest.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return CreateCertificateRequest.attributeTypeMap; + } +} + +export namespace CreateCertificateRequest { + export enum TypeEnum { + Uploaded = 'uploaded', + Managed = 'managed' + } +} diff --git a/ts_openapi/model/createCertificateResponse.ts b/ts_openapi/model/createCertificateResponse.ts new file mode 100644 index 0000000..91c699b --- /dev/null +++ b/ts_openapi/model/createCertificateResponse.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Certificate } from './certificate'; +import { NullableAction } from './nullableAction'; + +export class CreateCertificateResponse { + 'action'?: NullableAction | null; + 'certificate': Certificate; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "action", + "baseName": "action", + "type": "NullableAction" + }, + { + "name": "certificate", + "baseName": "certificate", + "type": "Certificate" + } ]; + + static getAttributeTypeMap() { + return CreateCertificateResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createFirewallRequest.ts b/ts_openapi/model/createFirewallRequest.ts new file mode 100644 index 0000000..9e6af7e --- /dev/null +++ b/ts_openapi/model/createFirewallRequest.ts @@ -0,0 +1,63 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { CreateFirewallRequestApplyToInner } from './createFirewallRequestApplyToInner'; +import { Rule } from './rule'; + +export class CreateFirewallRequest { + /** + * Resources the Firewall should be applied to after creation + */ + 'applyTo'?: Array; + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * Name of the Firewall + */ + 'name': string; + /** + * Array of rules + */ + 'rules'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "applyTo", + "baseName": "apply_to", + "type": "Array" + }, + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "rules", + "baseName": "rules", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return CreateFirewallRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createFirewallRequestApplyToInner.ts b/ts_openapi/model/createFirewallRequestApplyToInner.ts new file mode 100644 index 0000000..8b2bceb --- /dev/null +++ b/ts_openapi/model/createFirewallRequestApplyToInner.ts @@ -0,0 +1,54 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { CreateFirewallRequestApplyToInnerLabelSelector } from './createFirewallRequestApplyToInnerLabelSelector'; +import { CreateFirewallRequestApplyToInnerServer } from './createFirewallRequestApplyToInnerServer'; + +export class CreateFirewallRequestApplyToInner { + 'labelSelector'?: CreateFirewallRequestApplyToInnerLabelSelector; + 'server'?: CreateFirewallRequestApplyToInnerServer; + /** + * Type of the resource + */ + 'type': CreateFirewallRequestApplyToInner.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labelSelector", + "baseName": "label_selector", + "type": "CreateFirewallRequestApplyToInnerLabelSelector" + }, + { + "name": "server", + "baseName": "server", + "type": "CreateFirewallRequestApplyToInnerServer" + }, + { + "name": "type", + "baseName": "type", + "type": "CreateFirewallRequestApplyToInner.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return CreateFirewallRequestApplyToInner.attributeTypeMap; + } +} + +export namespace CreateFirewallRequestApplyToInner { + export enum TypeEnum { + Server = 'server', + LabelSelector = 'label_selector' + } +} diff --git a/ts_openapi/model/createFirewallRequestApplyToInnerLabelSelector.ts b/ts_openapi/model/createFirewallRequestApplyToInnerLabelSelector.ts new file mode 100644 index 0000000..8f7f960 --- /dev/null +++ b/ts_openapi/model/createFirewallRequestApplyToInnerLabelSelector.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Configuration for type LabelSelector, required if type is `label_selector` +*/ +export class CreateFirewallRequestApplyToInnerLabelSelector { + /** + * Label selector + */ + 'selector': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "selector", + "baseName": "selector", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return CreateFirewallRequestApplyToInnerLabelSelector.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createFirewallRequestApplyToInnerServer.ts b/ts_openapi/model/createFirewallRequestApplyToInnerServer.ts new file mode 100644 index 0000000..60a4b1a --- /dev/null +++ b/ts_openapi/model/createFirewallRequestApplyToInnerServer.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Configuration for type Server, required if type is `server` +*/ +export class CreateFirewallRequestApplyToInnerServer { + /** + * ID of the Server + */ + 'id': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return CreateFirewallRequestApplyToInnerServer.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createFirewallResponse.ts b/ts_openapi/model/createFirewallResponse.ts new file mode 100644 index 0000000..49db26d --- /dev/null +++ b/ts_openapi/model/createFirewallResponse.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; +import { Firewall } from './firewall'; + +export class CreateFirewallResponse { + 'actions'?: Array; + 'firewall'?: Firewall; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "actions", + "baseName": "actions", + "type": "Array" + }, + { + "name": "firewall", + "baseName": "firewall", + "type": "Firewall" + } ]; + + static getAttributeTypeMap() { + return CreateFirewallResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createFloatingIPRequest.ts b/ts_openapi/model/createFloatingIPRequest.ts new file mode 100644 index 0000000..07754b1 --- /dev/null +++ b/ts_openapi/model/createFloatingIPRequest.ts @@ -0,0 +1,79 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class CreateFloatingIPRequest { + 'description'?: string; + /** + * Home Location (routing is optimized for that Location). Only optional if Server argument is passed. + */ + 'homeLocation'?: string; + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + 'name'?: string; + /** + * ID of the Server to assign the Floating IP to + */ + 'server'?: number; + /** + * Floating IP type + */ + 'type': CreateFloatingIPRequest.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "homeLocation", + "baseName": "home_location", + "type": "string" + }, + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "server", + "baseName": "server", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "CreateFloatingIPRequest.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return CreateFloatingIPRequest.attributeTypeMap; + } +} + +export namespace CreateFloatingIPRequest { + export enum TypeEnum { + Ipv4 = 'ipv4', + Ipv6 = 'ipv6' + } +} diff --git a/ts_openapi/model/createImageRequest.ts b/ts_openapi/model/createImageRequest.ts new file mode 100644 index 0000000..0e0866f --- /dev/null +++ b/ts_openapi/model/createImageRequest.ts @@ -0,0 +1,56 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { CreateLoadBalancerRequestLabels } from './createLoadBalancerRequestLabels'; + +export class CreateImageRequest { + /** + * Description of the Image, will be auto-generated if not set + */ + 'description'?: string; + 'labels'?: CreateLoadBalancerRequestLabels; + /** + * Type of Image to create. + */ + 'type'?: CreateImageRequest.TypeEnum = CreateImageRequest.TypeEnum.Snapshot; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "labels", + "baseName": "labels", + "type": "CreateLoadBalancerRequestLabels" + }, + { + "name": "type", + "baseName": "type", + "type": "CreateImageRequest.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return CreateImageRequest.attributeTypeMap; + } +} + +export namespace CreateImageRequest { + export enum TypeEnum { + Snapshot = 'snapshot', + Backup = 'backup' + } +} diff --git a/ts_openapi/model/createLoadBalancerRequest.ts b/ts_openapi/model/createLoadBalancerRequest.ts new file mode 100644 index 0000000..7d52bbc --- /dev/null +++ b/ts_openapi/model/createLoadBalancerRequest.ts @@ -0,0 +1,113 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { CreateLoadBalancerRequestLabels } from './createLoadBalancerRequestLabels'; +import { LoadBalancerAlgorithm } from './loadBalancerAlgorithm'; +import { LoadBalancerService } from './loadBalancerService'; +import { LoadBalancerTarget } from './loadBalancerTarget'; + +export class CreateLoadBalancerRequest { + 'algorithm'?: LoadBalancerAlgorithm; + 'labels'?: CreateLoadBalancerRequestLabels; + /** + * ID or name of the Load Balancer type this Load Balancer should be created with + */ + 'loadBalancerType': string; + /** + * ID or name of Location to create Load Balancer in + */ + 'location'?: string; + /** + * Name of the Load Balancer + */ + 'name': string; + /** + * ID of the network the Load Balancer should be attached to on creation + */ + 'network'?: number; + /** + * Name of network zone + */ + 'networkZone'?: string; + /** + * Enable or disable the public interface of the Load Balancer + */ + 'publicInterface'?: boolean; + /** + * Array of services + */ + 'services'?: Array; + /** + * Array of targets + */ + 'targets'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "algorithm", + "baseName": "algorithm", + "type": "LoadBalancerAlgorithm" + }, + { + "name": "labels", + "baseName": "labels", + "type": "CreateLoadBalancerRequestLabels" + }, + { + "name": "loadBalancerType", + "baseName": "load_balancer_type", + "type": "string" + }, + { + "name": "location", + "baseName": "location", + "type": "string" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "network", + "baseName": "network", + "type": "number" + }, + { + "name": "networkZone", + "baseName": "network_zone", + "type": "string" + }, + { + "name": "publicInterface", + "baseName": "public_interface", + "type": "boolean" + }, + { + "name": "services", + "baseName": "services", + "type": "Array" + }, + { + "name": "targets", + "baseName": "targets", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return CreateLoadBalancerRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createLoadBalancerRequestLabels.ts b/ts_openapi/model/createLoadBalancerRequestLabels.ts new file mode 100644 index 0000000..397faaf --- /dev/null +++ b/ts_openapi/model/createLoadBalancerRequestLabels.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* User-defined labels (key-value pairs) +*/ +export class CreateLoadBalancerRequestLabels { + /** + * New label + */ + 'labelkey'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labelkey", + "baseName": "labelkey", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return CreateLoadBalancerRequestLabels.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createNetworkRequest.ts b/ts_openapi/model/createNetworkRequest.ts new file mode 100644 index 0000000..c239e60 --- /dev/null +++ b/ts_openapi/model/createNetworkRequest.ts @@ -0,0 +1,79 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { CreateLoadBalancerRequestLabels } from './createLoadBalancerRequestLabels'; +import { CreateNetworkRequestSubnetsInner } from './createNetworkRequestSubnetsInner'; +import { NetworksGet200ResponseNetworksInnerRoutesInner } from './networksGet200ResponseNetworksInnerRoutesInner'; + +export class CreateNetworkRequest { + /** + * Indicates if the routes from this network should be exposed to the vSwitch connection. The exposing only takes effect if a vSwitch connection is active. + */ + 'exposeRoutesToVswitch'?: boolean; + /** + * IP range of the whole network which must span all included subnets. Must be one of the private IPv4 ranges of RFC1918. Minimum network size is /24. We highly recommend that you pick a larger network with a /16 netmask. + */ + 'ipRange': string; + 'labels'?: CreateLoadBalancerRequestLabels; + /** + * Name of the network + */ + 'name': string; + /** + * Array of routes set in this network. The destination of the route must be one of the private IPv4 ranges of RFC1918. The gateway must be a subnet/IP of the ip_range of the network object. The destination must not overlap with an existing ip_range in any subnets or with any destinations in other routes or with the first IP of the networks ip_range or with 172.31.1.1. The gateway cannot be the first IP of the networks ip_range and also cannot be 172.31.1.1. + */ + 'routes'?: Array; + /** + * Array of subnets allocated. + */ + 'subnets'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "exposeRoutesToVswitch", + "baseName": "expose_routes_to_vswitch", + "type": "boolean" + }, + { + "name": "ipRange", + "baseName": "ip_range", + "type": "string" + }, + { + "name": "labels", + "baseName": "labels", + "type": "CreateLoadBalancerRequestLabels" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "routes", + "baseName": "routes", + "type": "Array" + }, + { + "name": "subnets", + "baseName": "subnets", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return CreateNetworkRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createNetworkRequestSubnetsInner.ts b/ts_openapi/model/createNetworkRequestSubnetsInner.ts new file mode 100644 index 0000000..d7e9816 --- /dev/null +++ b/ts_openapi/model/createNetworkRequestSubnetsInner.ts @@ -0,0 +1,68 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class CreateNetworkRequestSubnetsInner { + /** + * Range to allocate IPs from. Must be a Subnet of the ip_range of the parent network object and must not overlap with any other subnets or with any destinations in routes. Minimum Network size is /30. We suggest that you pick a bigger Network with a /24 netmask. + */ + 'ipRange'?: string; + /** + * Name of Network zone. The Location object contains the `network_zone` property each Location belongs to. + */ + 'networkZone': string; + /** + * Type of Subnetwork + */ + 'type': CreateNetworkRequestSubnetsInner.TypeEnum; + /** + * ID of the robot vSwitch. Must be supplied if the subnet is of type vswitch. + */ + 'vswitchId'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "ipRange", + "baseName": "ip_range", + "type": "string" + }, + { + "name": "networkZone", + "baseName": "network_zone", + "type": "string" + }, + { + "name": "type", + "baseName": "type", + "type": "CreateNetworkRequestSubnetsInner.TypeEnum" + }, + { + "name": "vswitchId", + "baseName": "vswitch_id", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return CreateNetworkRequestSubnetsInner.attributeTypeMap; + } +} + +export namespace CreateNetworkRequestSubnetsInner { + export enum TypeEnum { + Cloud = 'cloud', + Server = 'server', + Vswitch = 'vswitch' + } +} diff --git a/ts_openapi/model/createPlacementGroupRequest.ts b/ts_openapi/model/createPlacementGroupRequest.ts new file mode 100644 index 0000000..119f48f --- /dev/null +++ b/ts_openapi/model/createPlacementGroupRequest.ts @@ -0,0 +1,57 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class CreatePlacementGroupRequest { + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * Name of the PlacementGroup + */ + 'name': string; + /** + * Define the Placement Group Type. + */ + 'type': CreatePlacementGroupRequest.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "type", + "baseName": "type", + "type": "CreatePlacementGroupRequest.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return CreatePlacementGroupRequest.attributeTypeMap; + } +} + +export namespace CreatePlacementGroupRequest { + export enum TypeEnum { + Spread = 'spread' + } +} diff --git a/ts_openapi/model/createPlacementGroupResponse.ts b/ts_openapi/model/createPlacementGroupResponse.ts new file mode 100644 index 0000000..10e86bb --- /dev/null +++ b/ts_openapi/model/createPlacementGroupResponse.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { NullableAction } from './nullableAction'; +import { PlacementGroup } from './placementGroup'; + +export class CreatePlacementGroupResponse { + 'action'?: NullableAction | null; + 'placementGroup': PlacementGroup; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "action", + "baseName": "action", + "type": "NullableAction" + }, + { + "name": "placementGroup", + "baseName": "placement_group", + "type": "PlacementGroup" + } ]; + + static getAttributeTypeMap() { + return CreatePlacementGroupResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createPrimaryIPRequest.ts b/ts_openapi/model/createPrimaryIPRequest.ts new file mode 100644 index 0000000..cce8405 --- /dev/null +++ b/ts_openapi/model/createPrimaryIPRequest.ts @@ -0,0 +1,94 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class CreatePrimaryIPRequest { + /** + * ID of the resource the Primary IP should be assigned to. Omitted if it should not be assigned. + */ + 'assigneeId'?: number; + /** + * Resource type the Primary IP can be assigned to + */ + 'assigneeType': CreatePrimaryIPRequest.AssigneeTypeEnum; + /** + * Delete the Primary IP when the Server it is assigned to is deleted. + */ + 'autoDelete'?: boolean = false; + /** + * ID or name of Datacenter the Primary IP will be bound to. Needs to be omitted if `assignee_id` is passed. + */ + 'datacenter'?: string; + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + 'name': string; + /** + * Primary IP type + */ + 'type': CreatePrimaryIPRequest.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "assigneeId", + "baseName": "assignee_id", + "type": "number" + }, + { + "name": "assigneeType", + "baseName": "assignee_type", + "type": "CreatePrimaryIPRequest.AssigneeTypeEnum" + }, + { + "name": "autoDelete", + "baseName": "auto_delete", + "type": "boolean" + }, + { + "name": "datacenter", + "baseName": "datacenter", + "type": "string" + }, + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "type", + "baseName": "type", + "type": "CreatePrimaryIPRequest.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return CreatePrimaryIPRequest.attributeTypeMap; + } +} + +export namespace CreatePrimaryIPRequest { + export enum AssigneeTypeEnum { + Server = 'server' + } + export enum TypeEnum { + Ipv4 = 'ipv4', + Ipv6 = 'ipv6' + } +} diff --git a/ts_openapi/model/createPrimaryIPResponse.ts b/ts_openapi/model/createPrimaryIPResponse.ts new file mode 100644 index 0000000..ae57991 --- /dev/null +++ b/ts_openapi/model/createPrimaryIPResponse.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; +import { PrimaryIP } from './primaryIP'; + +export class CreatePrimaryIPResponse { + 'action'?: Action; + 'primaryIp': PrimaryIP; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "action", + "baseName": "action", + "type": "Action" + }, + { + "name": "primaryIp", + "baseName": "primary_ip", + "type": "PrimaryIP" + } ]; + + static getAttributeTypeMap() { + return CreatePrimaryIPResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createServerRequest.ts b/ts_openapi/model/createServerRequest.ts new file mode 100644 index 0000000..28d8bf7 --- /dev/null +++ b/ts_openapi/model/createServerRequest.ts @@ -0,0 +1,159 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { CreateServerRequestFirewallsInner } from './createServerRequestFirewallsInner'; +import { CreateServerRequestPublicNet } from './createServerRequestPublicNet'; + +export class CreateServerRequest { + /** + * Auto-mount Volumes after attach + */ + 'automount'?: boolean; + /** + * ID or name of Datacenter to create Server in (must not be used together with location) + */ + 'datacenter'?: string; + /** + * Firewalls which should be applied on the Server\'s public network interface at creation time + */ + 'firewalls'?: Array; + /** + * ID or name of the Image the Server is created from + */ + 'image': string; + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * ID or name of Location to create Server in (must not be used together with datacenter) + */ + 'location'?: string; + /** + * Name of the Server to create (must be unique per Project and a valid hostname as per RFC 1123) + */ + 'name': string; + /** + * Network IDs which should be attached to the Server private network interface at the creation time + */ + 'networks'?: Array; + /** + * ID of the Placement Group the server should be in + */ + 'placementGroup'?: number; + 'publicNet'?: CreateServerRequestPublicNet; + /** + * ID or name of the Server type this Server should be created with + */ + 'serverType': string; + /** + * SSH key IDs (`integer`) or names (`string`) which should be injected into the Server at creation time + */ + 'sshKeys'?: Array; + /** + * Start Server right after creation. + */ + 'startAfterCreate'?: boolean = true; + /** + * Cloud-Init user data to use during Server creation. This field is limited to 32KiB. + */ + 'userData'?: string; + /** + * Volume IDs which should be attached to the Server at the creation time. Volumes must be in the same Location. + */ + 'volumes'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "automount", + "baseName": "automount", + "type": "boolean" + }, + { + "name": "datacenter", + "baseName": "datacenter", + "type": "string" + }, + { + "name": "firewalls", + "baseName": "firewalls", + "type": "Array" + }, + { + "name": "image", + "baseName": "image", + "type": "string" + }, + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "location", + "baseName": "location", + "type": "string" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "networks", + "baseName": "networks", + "type": "Array" + }, + { + "name": "placementGroup", + "baseName": "placement_group", + "type": "number" + }, + { + "name": "publicNet", + "baseName": "public_net", + "type": "CreateServerRequestPublicNet" + }, + { + "name": "serverType", + "baseName": "server_type", + "type": "string" + }, + { + "name": "sshKeys", + "baseName": "ssh_keys", + "type": "Array" + }, + { + "name": "startAfterCreate", + "baseName": "start_after_create", + "type": "boolean" + }, + { + "name": "userData", + "baseName": "user_data", + "type": "string" + }, + { + "name": "volumes", + "baseName": "volumes", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return CreateServerRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createServerRequestFirewallsInner.ts b/ts_openapi/model/createServerRequestFirewallsInner.ts new file mode 100644 index 0000000..a65e6a3 --- /dev/null +++ b/ts_openapi/model/createServerRequestFirewallsInner.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class CreateServerRequestFirewallsInner { + /** + * ID of the Firewall + */ + 'firewall': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "firewall", + "baseName": "firewall", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return CreateServerRequestFirewallsInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createServerRequestPublicNet.ts b/ts_openapi/model/createServerRequestPublicNet.ts new file mode 100644 index 0000000..1b67e83 --- /dev/null +++ b/ts_openapi/model/createServerRequestPublicNet.ts @@ -0,0 +1,64 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Public Network options +*/ +export class CreateServerRequestPublicNet { + /** + * Attach an IPv4 on the public NIC. If false, no IPv4 address will be attached. + */ + 'enableIpv4'?: boolean = true; + /** + * Attach an IPv6 on the public NIC. If false, no IPv6 address will be attached. + */ + 'enableIpv6'?: boolean = true; + /** + * ID of the ipv4 Primary IP to use. If omitted and enable_ipv4 is true, a new ipv4 Primary IP will automatically be created. + */ + 'ipv4'?: number | null; + /** + * ID of the ipv6 Primary IP to use. If omitted and enable_ipv6 is true, a new ipv6 Primary IP will automatically be created. + */ + 'ipv6'?: number | null; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "enableIpv4", + "baseName": "enable_ipv4", + "type": "boolean" + }, + { + "name": "enableIpv6", + "baseName": "enable_ipv6", + "type": "boolean" + }, + { + "name": "ipv4", + "baseName": "ipv4", + "type": "number" + }, + { + "name": "ipv6", + "baseName": "ipv6", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return CreateServerRequestPublicNet.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createServerResponse.ts b/ts_openapi/model/createServerResponse.ts new file mode 100644 index 0000000..ad43909 --- /dev/null +++ b/ts_openapi/model/createServerResponse.ts @@ -0,0 +1,54 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; +import { ServersGet200ResponseServersInner } from './serversGet200ResponseServersInner'; + +export class CreateServerResponse { + 'action': Action; + 'nextActions': Array; + /** + * Root password when no SSH keys have been specified + */ + 'rootPassword': string | null; + 'server': ServersGet200ResponseServersInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "action", + "baseName": "action", + "type": "Action" + }, + { + "name": "nextActions", + "baseName": "next_actions", + "type": "Array" + }, + { + "name": "rootPassword", + "baseName": "root_password", + "type": "string" + }, + { + "name": "server", + "baseName": "server", + "type": "ServersGet200ResponseServersInner" + } ]; + + static getAttributeTypeMap() { + return CreateServerResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/createVolumeRequest.ts b/ts_openapi/model/createVolumeRequest.ts new file mode 100644 index 0000000..bc5bd84 --- /dev/null +++ b/ts_openapi/model/createVolumeRequest.ts @@ -0,0 +1,88 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class CreateVolumeRequest { + /** + * Auto-mount Volume after attach. `server` must be provided. + */ + 'automount'?: boolean; + /** + * Format Volume after creation. One of: `xfs`, `ext4` + */ + 'format'?: string; + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * Location to create the Volume in (can be omitted if Server is specified) + */ + 'location'?: string; + /** + * Name of the volume + */ + 'name': string; + /** + * Server to which to attach the Volume once it\'s created (Volume will be created in the same Location as the server) + */ + 'server'?: number; + /** + * Size of the Volume in GB + */ + 'size': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "automount", + "baseName": "automount", + "type": "boolean" + }, + { + "name": "format", + "baseName": "format", + "type": "string" + }, + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "location", + "baseName": "location", + "type": "string" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "server", + "baseName": "server", + "type": "number" + }, + { + "name": "size", + "baseName": "size", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return CreateVolumeRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/datacentersGet200Response.ts b/ts_openapi/model/datacentersGet200Response.ts new file mode 100644 index 0000000..1d8d176 --- /dev/null +++ b/ts_openapi/model/datacentersGet200Response.ts @@ -0,0 +1,48 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { DatacentersGet200ResponseDatacentersInner } from './datacentersGet200ResponseDatacentersInner'; + +export class DatacentersGet200Response { + 'datacenters': Array; + 'meta': ActionsResponseMeta; + /** + * The Datacenter which is recommended to be used to create new Servers. + */ + 'recommendation': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "datacenters", + "baseName": "datacenters", + "type": "Array" + }, + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + }, + { + "name": "recommendation", + "baseName": "recommendation", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return DatacentersGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/datacentersGet200ResponseDatacentersInner.ts b/ts_openapi/model/datacentersGet200ResponseDatacentersInner.ts new file mode 100644 index 0000000..3ecf365 --- /dev/null +++ b/ts_openapi/model/datacentersGet200ResponseDatacentersInner.ts @@ -0,0 +1,66 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { DatacentersGet200ResponseDatacentersInnerLocation } from './datacentersGet200ResponseDatacentersInnerLocation'; +import { DatacentersGet200ResponseDatacentersInnerServerTypes } from './datacentersGet200ResponseDatacentersInnerServerTypes'; + +export class DatacentersGet200ResponseDatacentersInner { + /** + * Description of the Datacenter + */ + 'description': string; + /** + * ID of the Resource + */ + 'id': number; + 'location': DatacentersGet200ResponseDatacentersInnerLocation; + /** + * Unique identifier of the Datacenter + */ + 'name': string; + 'serverTypes': DatacentersGet200ResponseDatacentersInnerServerTypes; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "location", + "baseName": "location", + "type": "DatacentersGet200ResponseDatacentersInnerLocation" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "serverTypes", + "baseName": "server_types", + "type": "DatacentersGet200ResponseDatacentersInnerServerTypes" + } ]; + + static getAttributeTypeMap() { + return DatacentersGet200ResponseDatacentersInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/datacentersGet200ResponseDatacentersInnerLocation.ts b/ts_openapi/model/datacentersGet200ResponseDatacentersInnerLocation.ts new file mode 100644 index 0000000..b1e4b15 --- /dev/null +++ b/ts_openapi/model/datacentersGet200ResponseDatacentersInnerLocation.ts @@ -0,0 +1,100 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* The location of the datacenter. +*/ +export class DatacentersGet200ResponseDatacentersInnerLocation { + /** + * City the Location is closest to + */ + 'city': string; + /** + * ISO 3166-1 alpha-2 code of the country the Location resides in + */ + 'country': string; + /** + * Description of the Location + */ + 'description': string; + /** + * ID of the Location + */ + 'id': number; + /** + * Latitude of the city closest to the Location + */ + 'latitude': number; + /** + * Longitude of the city closest to the Location + */ + 'longitude': number; + /** + * Unique identifier of the Location + */ + 'name': string; + /** + * Name of network zone this Location resides in + */ + 'networkZone': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "city", + "baseName": "city", + "type": "string" + }, + { + "name": "country", + "baseName": "country", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "latitude", + "baseName": "latitude", + "type": "number" + }, + { + "name": "longitude", + "baseName": "longitude", + "type": "number" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "networkZone", + "baseName": "network_zone", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return DatacentersGet200ResponseDatacentersInnerLocation.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/datacentersGet200ResponseDatacentersInnerServerTypes.ts b/ts_openapi/model/datacentersGet200ResponseDatacentersInnerServerTypes.ts new file mode 100644 index 0000000..8dce7ab --- /dev/null +++ b/ts_openapi/model/datacentersGet200ResponseDatacentersInnerServerTypes.ts @@ -0,0 +1,55 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* The Server types the Datacenter can handle +*/ +export class DatacentersGet200ResponseDatacentersInnerServerTypes { + /** + * IDs of Server types that are supported and for which the Datacenter has enough resources left + */ + 'available': Array; + /** + * IDs of Server types that are supported and for which the Datacenter has enough resources left + */ + 'availableForMigration': Array; + /** + * IDs of Server types that are supported in the Datacenter + */ + 'supported': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "available", + "baseName": "available", + "type": "Array" + }, + { + "name": "availableForMigration", + "baseName": "available_for_migration", + "type": "Array" + }, + { + "name": "supported", + "baseName": "supported", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return DatacentersGet200ResponseDatacentersInnerServerTypes.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/datacentersIdGet200Response.ts b/ts_openapi/model/datacentersIdGet200Response.ts new file mode 100644 index 0000000..bca04ec --- /dev/null +++ b/ts_openapi/model/datacentersIdGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { DatacentersGet200ResponseDatacentersInner } from './datacentersGet200ResponseDatacentersInner'; + +export class DatacentersIdGet200Response { + 'datacenter': DatacentersGet200ResponseDatacentersInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "datacenter", + "baseName": "datacenter", + "type": "DatacentersGet200ResponseDatacentersInner" + } ]; + + static getAttributeTypeMap() { + return DatacentersIdGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/deleteSubnetRequest.ts b/ts_openapi/model/deleteSubnetRequest.ts new file mode 100644 index 0000000..1e1107b --- /dev/null +++ b/ts_openapi/model/deleteSubnetRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class DeleteSubnetRequest { + /** + * IP range of subnet to delete + */ + 'ipRange': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "ipRange", + "baseName": "ip_range", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return DeleteSubnetRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/deprecationInfo.ts b/ts_openapi/model/deprecationInfo.ts new file mode 100644 index 0000000..5ec4885 --- /dev/null +++ b/ts_openapi/model/deprecationInfo.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Describes if, when & how the resources was deprecated. If this field is set to `null` the resource is not deprecated. If it has a value, it is considered deprecated. +*/ +export class DeprecationInfo { + /** + * Date of when the deprecation was announced. + */ + 'announced': string; + /** + * After the time in this field, the resource will not be available from the general listing endpoint of the resource type, and it can not be used in new resources. For example, if this is an image, you can not create new servers with this image after the mentioned date. + */ + 'unavailableAfter': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "announced", + "baseName": "announced", + "type": "string" + }, + { + "name": "unavailableAfter", + "baseName": "unavailable_after", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return DeprecationInfo.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/detachFromNetworkRequest.ts b/ts_openapi/model/detachFromNetworkRequest.ts new file mode 100644 index 0000000..2db2c4c --- /dev/null +++ b/ts_openapi/model/detachFromNetworkRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class DetachFromNetworkRequest { + /** + * ID of an existing network to detach the Server from + */ + 'network': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "network", + "baseName": "network", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return DetachFromNetworkRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/firewall.ts b/ts_openapi/model/firewall.ts new file mode 100644 index 0000000..f4c0f6f --- /dev/null +++ b/ts_openapi/model/firewall.ts @@ -0,0 +1,75 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FirewallAppliedToInner } from './firewallAppliedToInner'; +import { Rule } from './rule'; + +export class Firewall { + 'appliedTo': Array; + /** + * Point in time when the Resource was created (in ISO-8601 format) + */ + 'created': string; + /** + * ID of the Resource + */ + 'id': number; + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: { [key: string]: string; }; + /** + * Name of the Resource. Must be unique per Project. + */ + 'name': string; + 'rules': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "appliedTo", + "baseName": "applied_to", + "type": "Array" + }, + { + "name": "created", + "baseName": "created", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "labels", + "baseName": "labels", + "type": "{ [key: string]: string; }" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "rules", + "baseName": "rules", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return Firewall.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/firewallAppliedToInner.ts b/ts_openapi/model/firewallAppliedToInner.ts new file mode 100644 index 0000000..c541677 --- /dev/null +++ b/ts_openapi/model/firewallAppliedToInner.ts @@ -0,0 +1,61 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FirewallAppliedToInnerAppliedToResourcesInner } from './firewallAppliedToInnerAppliedToResourcesInner'; +import { FirewallAppliedToInnerAppliedToResourcesInnerServer } from './firewallAppliedToInnerAppliedToResourcesInnerServer'; +import { FirewallAppliedToInnerLabelSelector } from './firewallAppliedToInnerLabelSelector'; + +export class FirewallAppliedToInner { + 'appliedToResources'?: Array; + 'labelSelector'?: FirewallAppliedToInnerLabelSelector; + 'server'?: FirewallAppliedToInnerAppliedToResourcesInnerServer; + /** + * Type of resource referenced + */ + 'type': FirewallAppliedToInner.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "appliedToResources", + "baseName": "applied_to_resources", + "type": "Array" + }, + { + "name": "labelSelector", + "baseName": "label_selector", + "type": "FirewallAppliedToInnerLabelSelector" + }, + { + "name": "server", + "baseName": "server", + "type": "FirewallAppliedToInnerAppliedToResourcesInnerServer" + }, + { + "name": "type", + "baseName": "type", + "type": "FirewallAppliedToInner.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return FirewallAppliedToInner.attributeTypeMap; + } +} + +export namespace FirewallAppliedToInner { + export enum TypeEnum { + Server = 'server', + LabelSelector = 'label_selector' + } +} diff --git a/ts_openapi/model/firewallAppliedToInnerAppliedToResourcesInner.ts b/ts_openapi/model/firewallAppliedToInnerAppliedToResourcesInner.ts new file mode 100644 index 0000000..c209a2d --- /dev/null +++ b/ts_openapi/model/firewallAppliedToInnerAppliedToResourcesInner.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FirewallAppliedToInnerAppliedToResourcesInnerServer } from './firewallAppliedToInnerAppliedToResourcesInnerServer'; + +export class FirewallAppliedToInnerAppliedToResourcesInner { + 'server'?: FirewallAppliedToInnerAppliedToResourcesInnerServer; + /** + * Type of resource referenced + */ + 'type'?: FirewallAppliedToInnerAppliedToResourcesInner.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "server", + "baseName": "server", + "type": "FirewallAppliedToInnerAppliedToResourcesInnerServer" + }, + { + "name": "type", + "baseName": "type", + "type": "FirewallAppliedToInnerAppliedToResourcesInner.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return FirewallAppliedToInnerAppliedToResourcesInner.attributeTypeMap; + } +} + +export namespace FirewallAppliedToInnerAppliedToResourcesInner { + export enum TypeEnum { + Server = 'server' + } +} diff --git a/ts_openapi/model/firewallAppliedToInnerAppliedToResourcesInnerServer.ts b/ts_openapi/model/firewallAppliedToInnerAppliedToResourcesInnerServer.ts new file mode 100644 index 0000000..fcc454c --- /dev/null +++ b/ts_openapi/model/firewallAppliedToInnerAppliedToResourcesInnerServer.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class FirewallAppliedToInnerAppliedToResourcesInnerServer { + /** + * ID of the Resource + */ + 'id': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return FirewallAppliedToInnerAppliedToResourcesInnerServer.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/firewallAppliedToInnerLabelSelector.ts b/ts_openapi/model/firewallAppliedToInnerLabelSelector.ts new file mode 100644 index 0000000..edbd901 --- /dev/null +++ b/ts_openapi/model/firewallAppliedToInnerLabelSelector.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class FirewallAppliedToInnerLabelSelector { + /** + * Label selector + */ + 'selector': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "selector", + "baseName": "selector", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return FirewallAppliedToInnerLabelSelector.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/firewallApplyToResources.ts b/ts_openapi/model/firewallApplyToResources.ts new file mode 100644 index 0000000..1930888 --- /dev/null +++ b/ts_openapi/model/firewallApplyToResources.ts @@ -0,0 +1,54 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FirewallApplyToResourcesLabelSelector } from './firewallApplyToResourcesLabelSelector'; +import { FirewallApplyToResourcesServer } from './firewallApplyToResourcesServer'; + +export class FirewallApplyToResources { + 'labelSelector'?: FirewallApplyToResourcesLabelSelector; + 'server'?: FirewallApplyToResourcesServer; + /** + * Type of the resource + */ + 'type'?: FirewallApplyToResources.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labelSelector", + "baseName": "label_selector", + "type": "FirewallApplyToResourcesLabelSelector" + }, + { + "name": "server", + "baseName": "server", + "type": "FirewallApplyToResourcesServer" + }, + { + "name": "type", + "baseName": "type", + "type": "FirewallApplyToResources.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return FirewallApplyToResources.attributeTypeMap; + } +} + +export namespace FirewallApplyToResources { + export enum TypeEnum { + Server = 'server', + LabelSelector = 'label_selector' + } +} diff --git a/ts_openapi/model/firewallApplyToResourcesLabelSelector.ts b/ts_openapi/model/firewallApplyToResourcesLabelSelector.ts new file mode 100644 index 0000000..c48d94b --- /dev/null +++ b/ts_openapi/model/firewallApplyToResourcesLabelSelector.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Configuration for type label_selector, required if type is `label_selector` +*/ +export class FirewallApplyToResourcesLabelSelector { + /** + * Label selector + */ + 'selector': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "selector", + "baseName": "selector", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return FirewallApplyToResourcesLabelSelector.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/firewallApplyToResourcesServer.ts b/ts_openapi/model/firewallApplyToResourcesServer.ts new file mode 100644 index 0000000..8676d60 --- /dev/null +++ b/ts_openapi/model/firewallApplyToResourcesServer.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Configuration for type server, required if type is `server` +*/ +export class FirewallApplyToResourcesServer { + /** + * ID of the Server + */ + 'id': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return FirewallApplyToResourcesServer.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/firewallRemoveFromResources.ts b/ts_openapi/model/firewallRemoveFromResources.ts new file mode 100644 index 0000000..32b373b --- /dev/null +++ b/ts_openapi/model/firewallRemoveFromResources.ts @@ -0,0 +1,54 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FirewallApplyToResourcesLabelSelector } from './firewallApplyToResourcesLabelSelector'; +import { FirewallApplyToResourcesServer } from './firewallApplyToResourcesServer'; + +export class FirewallRemoveFromResources { + 'labelSelector'?: FirewallApplyToResourcesLabelSelector; + 'server'?: FirewallApplyToResourcesServer; + /** + * Type of the resource + */ + 'type'?: FirewallRemoveFromResources.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labelSelector", + "baseName": "label_selector", + "type": "FirewallApplyToResourcesLabelSelector" + }, + { + "name": "server", + "baseName": "server", + "type": "FirewallApplyToResourcesServer" + }, + { + "name": "type", + "baseName": "type", + "type": "FirewallRemoveFromResources.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return FirewallRemoveFromResources.attributeTypeMap; + } +} + +export namespace FirewallRemoveFromResources { + export enum TypeEnum { + Server = 'server', + LabelSelector = 'label_selector' + } +} diff --git a/ts_openapi/model/firewallResponse.ts b/ts_openapi/model/firewallResponse.ts new file mode 100644 index 0000000..111115d --- /dev/null +++ b/ts_openapi/model/firewallResponse.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Firewall } from './firewall'; + +export class FirewallResponse { + 'firewall': Firewall; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "firewall", + "baseName": "firewall", + "type": "Firewall" + } ]; + + static getAttributeTypeMap() { + return FirewallResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/firewallsResponse.ts b/ts_openapi/model/firewallsResponse.ts new file mode 100644 index 0000000..511c264 --- /dev/null +++ b/ts_openapi/model/firewallsResponse.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { Firewall } from './firewall'; + +export class FirewallsResponse { + 'firewalls': Array; + 'meta'?: ActionsResponseMeta; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "firewalls", + "baseName": "firewalls", + "type": "Array" + }, + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + } ]; + + static getAttributeTypeMap() { + return FirewallsResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/floatingIpsGet200Response.ts b/ts_openapi/model/floatingIpsGet200Response.ts new file mode 100644 index 0000000..ecbfa22 --- /dev/null +++ b/ts_openapi/model/floatingIpsGet200Response.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { FloatingIpsGet200ResponseFloatingIpsInner } from './floatingIpsGet200ResponseFloatingIpsInner'; + +export class FloatingIpsGet200Response { + 'floatingIps': Array; + 'meta'?: ActionsResponseMeta; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "floatingIps", + "baseName": "floating_ips", + "type": "Array" + }, + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + } ]; + + static getAttributeTypeMap() { + return FloatingIpsGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/floatingIpsGet200ResponseFloatingIpsInner.ts b/ts_openapi/model/floatingIpsGet200ResponseFloatingIpsInner.ts new file mode 100644 index 0000000..127c1fb --- /dev/null +++ b/ts_openapi/model/floatingIpsGet200ResponseFloatingIpsInner.ts @@ -0,0 +1,136 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FloatingIpsGet200ResponseFloatingIpsInnerDnsPtrInner } from './floatingIpsGet200ResponseFloatingIpsInnerDnsPtrInner'; +import { FloatingIpsGet200ResponseFloatingIpsInnerHomeLocation } from './floatingIpsGet200ResponseFloatingIpsInnerHomeLocation'; +import { FloatingIpsGet200ResponseFloatingIpsInnerProtection } from './floatingIpsGet200ResponseFloatingIpsInnerProtection'; + +export class FloatingIpsGet200ResponseFloatingIpsInner { + /** + * Whether the IP is blocked + */ + 'blocked': boolean; + /** + * Point in time when the Resource was created (in ISO-8601 format) + */ + 'created': string; + /** + * Description of the Resource + */ + 'description': string | null; + /** + * Array of reverse DNS entries + */ + 'dnsPtr': Array; + 'homeLocation': FloatingIpsGet200ResponseFloatingIpsInnerHomeLocation; + /** + * ID of the Resource + */ + 'id': number; + /** + * IP address + */ + 'ip': string; + /** + * User-defined labels (key-value pairs) + */ + 'labels': { [key: string]: string; }; + /** + * Name of the Resource. Must be unique per Project. + */ + 'name': string; + 'protection': FloatingIpsGet200ResponseFloatingIpsInnerProtection; + /** + * ID of the Server the Floating IP is assigned to, null if it is not assigned at all + */ + 'server': number | null; + /** + * Type of the Floating IP + */ + 'type': FloatingIpsGet200ResponseFloatingIpsInner.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "blocked", + "baseName": "blocked", + "type": "boolean" + }, + { + "name": "created", + "baseName": "created", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "dnsPtr", + "baseName": "dns_ptr", + "type": "Array" + }, + { + "name": "homeLocation", + "baseName": "home_location", + "type": "FloatingIpsGet200ResponseFloatingIpsInnerHomeLocation" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + }, + { + "name": "labels", + "baseName": "labels", + "type": "{ [key: string]: string; }" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "protection", + "baseName": "protection", + "type": "FloatingIpsGet200ResponseFloatingIpsInnerProtection" + }, + { + "name": "server", + "baseName": "server", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "FloatingIpsGet200ResponseFloatingIpsInner.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return FloatingIpsGet200ResponseFloatingIpsInner.attributeTypeMap; + } +} + +export namespace FloatingIpsGet200ResponseFloatingIpsInner { + export enum TypeEnum { + Ipv4 = 'ipv4', + Ipv6 = 'ipv6' + } +} diff --git a/ts_openapi/model/floatingIpsGet200ResponseFloatingIpsInnerDnsPtrInner.ts b/ts_openapi/model/floatingIpsGet200ResponseFloatingIpsInnerDnsPtrInner.ts new file mode 100644 index 0000000..3f53f5c --- /dev/null +++ b/ts_openapi/model/floatingIpsGet200ResponseFloatingIpsInnerDnsPtrInner.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class FloatingIpsGet200ResponseFloatingIpsInnerDnsPtrInner { + /** + * DNS pointer for the specific IP address + */ + 'dnsPtr': string; + /** + * Single IPv4 or IPv6 address + */ + 'ip': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "dnsPtr", + "baseName": "dns_ptr", + "type": "string" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return FloatingIpsGet200ResponseFloatingIpsInnerDnsPtrInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/floatingIpsGet200ResponseFloatingIpsInnerHomeLocation.ts b/ts_openapi/model/floatingIpsGet200ResponseFloatingIpsInnerHomeLocation.ts new file mode 100644 index 0000000..9e595cd --- /dev/null +++ b/ts_openapi/model/floatingIpsGet200ResponseFloatingIpsInnerHomeLocation.ts @@ -0,0 +1,100 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Location the Floating IP was created in. Routing is optimized for this Location. +*/ +export class FloatingIpsGet200ResponseFloatingIpsInnerHomeLocation { + /** + * City the Location is closest to + */ + 'city': string; + /** + * ISO 3166-1 alpha-2 code of the country the Location resides in + */ + 'country': string; + /** + * Description of the Location + */ + 'description': string; + /** + * ID of the Location + */ + 'id': number; + /** + * Latitude of the city closest to the Location + */ + 'latitude': number; + /** + * Longitude of the city closest to the Location + */ + 'longitude': number; + /** + * Unique identifier of the Location + */ + 'name': string; + /** + * Name of network zone this Location resides in + */ + 'networkZone': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "city", + "baseName": "city", + "type": "string" + }, + { + "name": "country", + "baseName": "country", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "latitude", + "baseName": "latitude", + "type": "number" + }, + { + "name": "longitude", + "baseName": "longitude", + "type": "number" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "networkZone", + "baseName": "network_zone", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return FloatingIpsGet200ResponseFloatingIpsInnerHomeLocation.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/floatingIpsGet200ResponseFloatingIpsInnerProtection.ts b/ts_openapi/model/floatingIpsGet200ResponseFloatingIpsInnerProtection.ts new file mode 100644 index 0000000..2320632 --- /dev/null +++ b/ts_openapi/model/floatingIpsGet200ResponseFloatingIpsInnerProtection.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Protection configuration for the Resource +*/ +export class FloatingIpsGet200ResponseFloatingIpsInnerProtection { + /** + * If true, prevents the Resource from being deleted + */ + '_delete': boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "_delete", + "baseName": "delete", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return FloatingIpsGet200ResponseFloatingIpsInnerProtection.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/floatingIpsIdActionsGet200Response.ts b/ts_openapi/model/floatingIpsIdActionsGet200Response.ts new file mode 100644 index 0000000..3e17f9b --- /dev/null +++ b/ts_openapi/model/floatingIpsIdActionsGet200Response.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; +import { ActionsResponseMeta } from './actionsResponseMeta'; + +export class FloatingIpsIdActionsGet200Response { + 'actions': Array; + 'meta'?: ActionsResponseMeta; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "actions", + "baseName": "actions", + "type": "Array" + }, + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + } ]; + + static getAttributeTypeMap() { + return FloatingIpsIdActionsGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/floatingIpsIdGet200Response.ts b/ts_openapi/model/floatingIpsIdGet200Response.ts new file mode 100644 index 0000000..ef03656 --- /dev/null +++ b/ts_openapi/model/floatingIpsIdGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FloatingIpsGet200ResponseFloatingIpsInner } from './floatingIpsGet200ResponseFloatingIpsInner'; + +export class FloatingIpsIdGet200Response { + 'floatingIp': FloatingIpsGet200ResponseFloatingIpsInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "floatingIp", + "baseName": "floating_ip", + "type": "FloatingIpsGet200ResponseFloatingIpsInner" + } ]; + + static getAttributeTypeMap() { + return FloatingIpsIdGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/floatingIpsPost201Response.ts b/ts_openapi/model/floatingIpsPost201Response.ts new file mode 100644 index 0000000..4440a71 --- /dev/null +++ b/ts_openapi/model/floatingIpsPost201Response.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; +import { FloatingIpsGet200ResponseFloatingIpsInner } from './floatingIpsGet200ResponseFloatingIpsInner'; + +export class FloatingIpsPost201Response { + 'action'?: Action; + 'floatingIp': FloatingIpsGet200ResponseFloatingIpsInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "action", + "baseName": "action", + "type": "Action" + }, + { + "name": "floatingIp", + "baseName": "floating_ip", + "type": "FloatingIpsGet200ResponseFloatingIpsInner" + } ]; + + static getAttributeTypeMap() { + return FloatingIpsPost201Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/imagesGet200Response.ts b/ts_openapi/model/imagesGet200Response.ts new file mode 100644 index 0000000..93ab8c5 --- /dev/null +++ b/ts_openapi/model/imagesGet200Response.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { ImagesGet200ResponseImagesInner } from './imagesGet200ResponseImagesInner'; + +export class ImagesGet200Response { + 'images': Array; + 'meta'?: ActionsResponseMeta; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "images", + "baseName": "images", + "type": "Array" + }, + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + } ]; + + static getAttributeTypeMap() { + return ImagesGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/imagesGet200ResponseImagesInner.ts b/ts_openapi/model/imagesGet200ResponseImagesInner.ts new file mode 100644 index 0000000..cb79c22 --- /dev/null +++ b/ts_openapi/model/imagesGet200ResponseImagesInner.ts @@ -0,0 +1,210 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FloatingIpsGet200ResponseFloatingIpsInnerProtection } from './floatingIpsGet200ResponseFloatingIpsInnerProtection'; +import { ImagesGet200ResponseImagesInnerCreatedFrom } from './imagesGet200ResponseImagesInnerCreatedFrom'; + +export class ImagesGet200ResponseImagesInner { + /** + * Type of cpu architecture this image is compatible with. + */ + 'architecture': ImagesGet200ResponseImagesInner.ArchitectureEnum; + /** + * ID of Server the Image is bound to. Only set for Images of type `backup`. + */ + 'boundTo': number | null; + /** + * Point in time when the Resource was created (in ISO-8601 format) + */ + 'created': string; + 'createdFrom': ImagesGet200ResponseImagesInnerCreatedFrom | null; + /** + * Point in time where the Image was deleted (in ISO-8601 format) + */ + 'deleted': string | null; + /** + * Point in time when the Image is considered to be deprecated (in ISO-8601 format) + */ + 'deprecated': string | null; + /** + * Description of the Image + */ + 'description': string; + /** + * Size of the disk contained in the Image in GB + */ + 'diskSize': number; + /** + * ID of the Resource + */ + 'id': number; + /** + * Size of the Image file in our storage in GB. For snapshot Images this is the value relevant for calculating costs for the Image. + */ + 'imageSize': number | null; + /** + * User-defined labels (key-value pairs) + */ + 'labels': { [key: string]: string; }; + /** + * Unique identifier of the Image. This value is only set for system Images. + */ + 'name': string | null; + /** + * Flavor of operating system contained in the Image + */ + 'osFlavor': ImagesGet200ResponseImagesInner.OsFlavorEnum; + /** + * Operating system version + */ + 'osVersion': string | null; + 'protection': FloatingIpsGet200ResponseFloatingIpsInnerProtection; + /** + * Indicates that rapid deploy of the Image is available + */ + 'rapidDeploy'?: boolean; + /** + * Whether the Image can be used or if it\'s still being created or unavailable + */ + 'status': ImagesGet200ResponseImagesInner.StatusEnum; + /** + * Type of the Image + */ + 'type': ImagesGet200ResponseImagesInner.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "architecture", + "baseName": "architecture", + "type": "ImagesGet200ResponseImagesInner.ArchitectureEnum" + }, + { + "name": "boundTo", + "baseName": "bound_to", + "type": "number" + }, + { + "name": "created", + "baseName": "created", + "type": "string" + }, + { + "name": "createdFrom", + "baseName": "created_from", + "type": "ImagesGet200ResponseImagesInnerCreatedFrom" + }, + { + "name": "deleted", + "baseName": "deleted", + "type": "string" + }, + { + "name": "deprecated", + "baseName": "deprecated", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "diskSize", + "baseName": "disk_size", + "type": "number" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "imageSize", + "baseName": "image_size", + "type": "number" + }, + { + "name": "labels", + "baseName": "labels", + "type": "{ [key: string]: string; }" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "osFlavor", + "baseName": "os_flavor", + "type": "ImagesGet200ResponseImagesInner.OsFlavorEnum" + }, + { + "name": "osVersion", + "baseName": "os_version", + "type": "string" + }, + { + "name": "protection", + "baseName": "protection", + "type": "FloatingIpsGet200ResponseFloatingIpsInnerProtection" + }, + { + "name": "rapidDeploy", + "baseName": "rapid_deploy", + "type": "boolean" + }, + { + "name": "status", + "baseName": "status", + "type": "ImagesGet200ResponseImagesInner.StatusEnum" + }, + { + "name": "type", + "baseName": "type", + "type": "ImagesGet200ResponseImagesInner.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return ImagesGet200ResponseImagesInner.attributeTypeMap; + } +} + +export namespace ImagesGet200ResponseImagesInner { + export enum ArchitectureEnum { + X86 = 'x86', + Arm = 'arm' + } + export enum OsFlavorEnum { + Ubuntu = 'ubuntu', + Centos = 'centos', + Debian = 'debian', + Fedora = 'fedora', + Rocky = 'rocky', + Alma = 'alma', + Unknown = 'unknown' + } + export enum StatusEnum { + Available = 'available', + Creating = 'creating', + Unavailable = 'unavailable' + } + export enum TypeEnum { + System = 'system', + App = 'app', + Snapshot = 'snapshot', + Backup = 'backup', + Temporary = 'temporary' + } +} diff --git a/ts_openapi/model/imagesGet200ResponseImagesInnerCreatedFrom.ts b/ts_openapi/model/imagesGet200ResponseImagesInnerCreatedFrom.ts new file mode 100644 index 0000000..224c2b9 --- /dev/null +++ b/ts_openapi/model/imagesGet200ResponseImagesInnerCreatedFrom.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Information about the Server the Image was created from +*/ +export class ImagesGet200ResponseImagesInnerCreatedFrom { + /** + * ID of the Server the Image was created from + */ + 'id': number; + /** + * Server name at the time the Image was created + */ + 'name': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ImagesGet200ResponseImagesInnerCreatedFrom.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/imagesIdActionsChangeProtectionPostRequest.ts b/ts_openapi/model/imagesIdActionsChangeProtectionPostRequest.ts new file mode 100644 index 0000000..dadf2b4 --- /dev/null +++ b/ts_openapi/model/imagesIdActionsChangeProtectionPostRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ImagesIdActionsChangeProtectionPostRequest { + /** + * If true, prevents the snapshot from being deleted + */ + '_delete'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "_delete", + "baseName": "delete", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return ImagesIdActionsChangeProtectionPostRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/imagesIdGet200Response.ts b/ts_openapi/model/imagesIdGet200Response.ts new file mode 100644 index 0000000..e686fe4 --- /dev/null +++ b/ts_openapi/model/imagesIdGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ImagesGet200ResponseImagesInner } from './imagesGet200ResponseImagesInner'; + +export class ImagesIdGet200Response { + 'image'?: ImagesGet200ResponseImagesInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "image", + "baseName": "image", + "type": "ImagesGet200ResponseImagesInner" + } ]; + + static getAttributeTypeMap() { + return ImagesIdGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/isosGet200Response.ts b/ts_openapi/model/isosGet200Response.ts new file mode 100644 index 0000000..4b87f65 --- /dev/null +++ b/ts_openapi/model/isosGet200Response.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { IsosGet200ResponseIsosInner } from './isosGet200ResponseIsosInner'; + +export class IsosGet200Response { + 'isos': Array; + 'meta'?: ActionsResponseMeta; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "isos", + "baseName": "isos", + "type": "Array" + }, + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + } ]; + + static getAttributeTypeMap() { + return IsosGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/isosGet200ResponseIsosInner.ts b/ts_openapi/model/isosGet200ResponseIsosInner.ts new file mode 100644 index 0000000..ada01bc --- /dev/null +++ b/ts_openapi/model/isosGet200ResponseIsosInner.ts @@ -0,0 +1,87 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { DeprecationInfo } from './deprecationInfo'; + +export class IsosGet200ResponseIsosInner { + /** + * Type of cpu architecture this iso is compatible with. Null indicates no restriction on the architecture (wildcard). + */ + 'architecture': IsosGet200ResponseIsosInner.ArchitectureEnum; + 'deprecation': DeprecationInfo | null; + /** + * Description of the ISO + */ + 'description': string; + /** + * ID of the Resource + */ + 'id': number; + /** + * Unique identifier of the ISO. Only set for public ISOs + */ + 'name': string | null; + /** + * Type of the ISO + */ + 'type': IsosGet200ResponseIsosInner.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "architecture", + "baseName": "architecture", + "type": "IsosGet200ResponseIsosInner.ArchitectureEnum" + }, + { + "name": "deprecation", + "baseName": "deprecation", + "type": "DeprecationInfo" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "type", + "baseName": "type", + "type": "IsosGet200ResponseIsosInner.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return IsosGet200ResponseIsosInner.attributeTypeMap; + } +} + +export namespace IsosGet200ResponseIsosInner { + export enum ArchitectureEnum { + X86 = 'x86', + Arm = 'arm' + } + export enum TypeEnum { + Public = 'public', + Private = 'private' + } +} diff --git a/ts_openapi/model/isosIdGet200Response.ts b/ts_openapi/model/isosIdGet200Response.ts new file mode 100644 index 0000000..291d05e --- /dev/null +++ b/ts_openapi/model/isosIdGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { IsosGet200ResponseIsosInner } from './isosGet200ResponseIsosInner'; + +export class IsosIdGet200Response { + 'iso': IsosGet200ResponseIsosInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "iso", + "baseName": "iso", + "type": "IsosGet200ResponseIsosInner" + } ]; + + static getAttributeTypeMap() { + return IsosIdGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancerAlgorithm.ts b/ts_openapi/model/loadBalancerAlgorithm.ts new file mode 100644 index 0000000..da18813 --- /dev/null +++ b/ts_openapi/model/loadBalancerAlgorithm.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Algorithm of the Load Balancer +*/ +export class LoadBalancerAlgorithm { + /** + * Type of the algorithm. + */ + 'type': LoadBalancerAlgorithm.TypeEnum = LoadBalancerAlgorithm.TypeEnum.RoundRobin; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "LoadBalancerAlgorithm.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerAlgorithm.attributeTypeMap; + } +} + +export namespace LoadBalancerAlgorithm { + export enum TypeEnum { + RoundRobin = 'round_robin', + LeastConnections = 'least_connections' + } +} diff --git a/ts_openapi/model/loadBalancerService.ts b/ts_openapi/model/loadBalancerService.ts new file mode 100644 index 0000000..0823a92 --- /dev/null +++ b/ts_openapi/model/loadBalancerService.ts @@ -0,0 +1,82 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancerServiceHTTP } from './loadBalancerServiceHTTP'; +import { LoadBalancerServiceHealthCheck } from './loadBalancerServiceHealthCheck'; + +export class LoadBalancerService { + /** + * Port the Load Balancer will balance to + */ + 'destinationPort': number; + 'healthCheck': LoadBalancerServiceHealthCheck; + 'http'?: LoadBalancerServiceHTTP; + /** + * Port the Load Balancer listens on + */ + 'listenPort': number; + /** + * Protocol of the Load Balancer + */ + 'protocol': LoadBalancerService.ProtocolEnum; + /** + * Is Proxyprotocol enabled or not + */ + 'proxyprotocol': boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "destinationPort", + "baseName": "destination_port", + "type": "number" + }, + { + "name": "healthCheck", + "baseName": "health_check", + "type": "LoadBalancerServiceHealthCheck" + }, + { + "name": "http", + "baseName": "http", + "type": "LoadBalancerServiceHTTP" + }, + { + "name": "listenPort", + "baseName": "listen_port", + "type": "number" + }, + { + "name": "protocol", + "baseName": "protocol", + "type": "LoadBalancerService.ProtocolEnum" + }, + { + "name": "proxyprotocol", + "baseName": "proxyprotocol", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerService.attributeTypeMap; + } +} + +export namespace LoadBalancerService { + export enum ProtocolEnum { + Tcp = 'tcp', + Http = 'http', + Https = 'https' + } +} diff --git a/ts_openapi/model/loadBalancerServiceHTTP.ts b/ts_openapi/model/loadBalancerServiceHTTP.ts new file mode 100644 index 0000000..480a3d1 --- /dev/null +++ b/ts_openapi/model/loadBalancerServiceHTTP.ts @@ -0,0 +1,73 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Configuration option for protocols http and https +*/ +export class LoadBalancerServiceHTTP { + /** + * IDs of the Certificates to use for TLS/SSL termination by the Load Balancer; empty for TLS/SSL passthrough or if `protocol` is `http`. + */ + 'certificates'?: Array; + /** + * Lifetime of the cookie used for sticky sessions (in seconds). + */ + 'cookieLifetime'?: number = 300; + /** + * Name of the cookie used for sticky sessions. + */ + 'cookieName'?: string = 'HCLBSTICKY'; + /** + * Redirect HTTP requests to HTTPS. Only available if `protocol` is `https`. + */ + 'redirectHttp'?: boolean = false; + /** + * Use sticky sessions. Only available if `protocol` is `http` or `https`. + */ + 'stickySessions'?: boolean = false; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "certificates", + "baseName": "certificates", + "type": "Array" + }, + { + "name": "cookieLifetime", + "baseName": "cookie_lifetime", + "type": "number" + }, + { + "name": "cookieName", + "baseName": "cookie_name", + "type": "string" + }, + { + "name": "redirectHttp", + "baseName": "redirect_http", + "type": "boolean" + }, + { + "name": "stickySessions", + "baseName": "sticky_sessions", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerServiceHTTP.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancerServiceHTTP1.ts b/ts_openapi/model/loadBalancerServiceHTTP1.ts new file mode 100644 index 0000000..9deea90 --- /dev/null +++ b/ts_openapi/model/loadBalancerServiceHTTP1.ts @@ -0,0 +1,73 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Configuration option for protocols http and https +*/ +export class LoadBalancerServiceHTTP1 { + /** + * IDs of the Certificates to use for TLS/SSL termination by the Load Balancer; empty for TLS/SSL passthrough or if `protocol` is \"http\" + */ + 'certificates'?: Array; + /** + * Lifetime of the cookie used for sticky sessions (in seconds) + */ + 'cookieLifetime'?: number; + /** + * Name of the cookie used for sticky sessions + */ + 'cookieName'?: string; + /** + * Redirect HTTP requests to HTTPS. Only available if protocol is \"https\". + */ + 'redirectHttp'?: boolean = false; + /** + * Use sticky sessions. Only available if protocol is \"http\" or \"https\". + */ + 'stickySessions'?: boolean = false; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "certificates", + "baseName": "certificates", + "type": "Array" + }, + { + "name": "cookieLifetime", + "baseName": "cookie_lifetime", + "type": "number" + }, + { + "name": "cookieName", + "baseName": "cookie_name", + "type": "string" + }, + { + "name": "redirectHttp", + "baseName": "redirect_http", + "type": "boolean" + }, + { + "name": "stickySessions", + "baseName": "sticky_sessions", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerServiceHTTP1.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancerServiceHealthCheck.ts b/ts_openapi/model/loadBalancerServiceHealthCheck.ts new file mode 100644 index 0000000..d1b8641 --- /dev/null +++ b/ts_openapi/model/loadBalancerServiceHealthCheck.ts @@ -0,0 +1,86 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancerServiceHealthCheckHttp } from './loadBalancerServiceHealthCheckHttp'; + +/** +* Service health check +*/ +export class LoadBalancerServiceHealthCheck { + 'http'?: LoadBalancerServiceHealthCheckHttp; + /** + * Time interval in seconds health checks are performed + */ + 'interval': number; + /** + * Port the health check will be performed on + */ + 'port': number; + /** + * Type of the health check + */ + 'protocol': LoadBalancerServiceHealthCheck.ProtocolEnum; + /** + * Unsuccessful retries needed until a target is considered unhealthy; an unhealthy target needs the same number of successful retries to become healthy again + */ + 'retries': number; + /** + * Time in seconds after an attempt is considered a timeout + */ + 'timeout': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "http", + "baseName": "http", + "type": "LoadBalancerServiceHealthCheckHttp" + }, + { + "name": "interval", + "baseName": "interval", + "type": "number" + }, + { + "name": "port", + "baseName": "port", + "type": "number" + }, + { + "name": "protocol", + "baseName": "protocol", + "type": "LoadBalancerServiceHealthCheck.ProtocolEnum" + }, + { + "name": "retries", + "baseName": "retries", + "type": "number" + }, + { + "name": "timeout", + "baseName": "timeout", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerServiceHealthCheck.attributeTypeMap; + } +} + +export namespace LoadBalancerServiceHealthCheck { + export enum ProtocolEnum { + Tcp = 'tcp', + Http = 'http' + } +} diff --git a/ts_openapi/model/loadBalancerServiceHealthCheckHttp.ts b/ts_openapi/model/loadBalancerServiceHealthCheckHttp.ts new file mode 100644 index 0000000..978403b --- /dev/null +++ b/ts_openapi/model/loadBalancerServiceHealthCheckHttp.ts @@ -0,0 +1,73 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Additional configuration for protocol http +*/ +export class LoadBalancerServiceHealthCheckHttp { + /** + * Host header to send in the HTTP request. May not contain spaces, percent or backslash symbols. Can be null, in that case no host header is sent. + */ + 'domain': string | null; + /** + * HTTP path to use for health checks. May not contain literal spaces, use percent-encoding instead. + */ + 'path': string; + /** + * String that must be contained in HTTP response in order to pass the health check + */ + 'response'?: string; + /** + * List of returned HTTP status codes in order to pass the health check. Supports the wildcards `?` for exactly one character and `*` for multiple ones. + */ + 'statusCodes'?: Array; + /** + * Use HTTPS for health check + */ + 'tls'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "domain", + "baseName": "domain", + "type": "string" + }, + { + "name": "path", + "baseName": "path", + "type": "string" + }, + { + "name": "response", + "baseName": "response", + "type": "string" + }, + { + "name": "statusCodes", + "baseName": "status_codes", + "type": "Array" + }, + { + "name": "tls", + "baseName": "tls", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerServiceHealthCheckHttp.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancerTarget.ts b/ts_openapi/model/loadBalancerTarget.ts new file mode 100644 index 0000000..de84e3a --- /dev/null +++ b/ts_openapi/model/loadBalancerTarget.ts @@ -0,0 +1,91 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancerTargetHealthStatusInner } from './loadBalancerTargetHealthStatusInner'; +import { LoadBalancerTargetIP } from './loadBalancerTargetIP'; +import { LoadBalancerTargetLabelSelector } from './loadBalancerTargetLabelSelector'; +import { LoadBalancerTargetServer } from './loadBalancerTargetServer'; +import { LoadBalancerTargetTarget } from './loadBalancerTargetTarget'; + +export class LoadBalancerTarget { + /** + * List of health statuses of the services on this target. Only present for target types \"server\" and \"ip\". + */ + 'healthStatus'?: Array; + 'ip'?: LoadBalancerTargetIP; + 'labelSelector'?: LoadBalancerTargetLabelSelector; + 'server'?: LoadBalancerTargetServer; + /** + * List of resolved label selector target Servers. Only present for type \"label_selector\". + */ + 'targets'?: Array; + /** + * Type of the resource + */ + 'type': LoadBalancerTarget.TypeEnum; + /** + * Use the private network IP instead of the public IP. Only present for target types \"server\" and \"label_selector\". + */ + 'usePrivateIp'?: boolean = false; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "healthStatus", + "baseName": "health_status", + "type": "Array" + }, + { + "name": "ip", + "baseName": "ip", + "type": "LoadBalancerTargetIP" + }, + { + "name": "labelSelector", + "baseName": "label_selector", + "type": "LoadBalancerTargetLabelSelector" + }, + { + "name": "server", + "baseName": "server", + "type": "LoadBalancerTargetServer" + }, + { + "name": "targets", + "baseName": "targets", + "type": "Array" + }, + { + "name": "type", + "baseName": "type", + "type": "LoadBalancerTarget.TypeEnum" + }, + { + "name": "usePrivateIp", + "baseName": "use_private_ip", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerTarget.attributeTypeMap; + } +} + +export namespace LoadBalancerTarget { + export enum TypeEnum { + Server = 'server', + LabelSelector = 'label_selector', + Ip = 'ip' + } +} diff --git a/ts_openapi/model/loadBalancerTargetHealthStatusInner.ts b/ts_openapi/model/loadBalancerTargetHealthStatusInner.ts new file mode 100644 index 0000000..b465c1c --- /dev/null +++ b/ts_openapi/model/loadBalancerTargetHealthStatusInner.ts @@ -0,0 +1,44 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class LoadBalancerTargetHealthStatusInner { + 'listenPort'?: number; + 'status'?: LoadBalancerTargetHealthStatusInner.StatusEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "listenPort", + "baseName": "listen_port", + "type": "number" + }, + { + "name": "status", + "baseName": "status", + "type": "LoadBalancerTargetHealthStatusInner.StatusEnum" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerTargetHealthStatusInner.attributeTypeMap; + } +} + +export namespace LoadBalancerTargetHealthStatusInner { + export enum StatusEnum { + Healthy = 'healthy', + Unhealthy = 'unhealthy', + Unknown = 'unknown' + } +} diff --git a/ts_openapi/model/loadBalancerTargetIP.ts b/ts_openapi/model/loadBalancerTargetIP.ts new file mode 100644 index 0000000..a193556 --- /dev/null +++ b/ts_openapi/model/loadBalancerTargetIP.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* IP targets where the traffic should be routed to. It is only possible to use the (Public or vSwitch) IPs of Hetzner Online Root Servers belonging to the project owner. IPs belonging to other users are blocked. Additionally IPs belonging to services provided by Hetzner Cloud (Servers, Load Balancers, ...) are blocked as well. Only present for target type \"ip\". +*/ +export class LoadBalancerTargetIP { + /** + * IP of a server that belongs to the same customer (public IPv4/IPv6) or private IP in a Subnetwork type vswitch. + */ + 'ip': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "ip", + "baseName": "ip", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerTargetIP.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancerTargetLabelSelector.ts b/ts_openapi/model/loadBalancerTargetLabelSelector.ts new file mode 100644 index 0000000..364631b --- /dev/null +++ b/ts_openapi/model/loadBalancerTargetLabelSelector.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Label selector used to determine targets. Only present for target type \"label_selector\". +*/ +export class LoadBalancerTargetLabelSelector { + /** + * Label selector + */ + 'selector': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "selector", + "baseName": "selector", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerTargetLabelSelector.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancerTargetServer.ts b/ts_openapi/model/loadBalancerTargetServer.ts new file mode 100644 index 0000000..1c64736 --- /dev/null +++ b/ts_openapi/model/loadBalancerTargetServer.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Server where the traffic should be routed to. Only present for target type \"server\". +*/ +export class LoadBalancerTargetServer { + /** + * ID of the Server + */ + 'id': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerTargetServer.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancerTargetTarget.ts b/ts_openapi/model/loadBalancerTargetTarget.ts new file mode 100644 index 0000000..0ba04a4 --- /dev/null +++ b/ts_openapi/model/loadBalancerTargetTarget.ts @@ -0,0 +1,60 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancerTargetHealthStatusInner } from './loadBalancerTargetHealthStatusInner'; +import { LoadBalancerTargetServer } from './loadBalancerTargetServer'; + +export class LoadBalancerTargetTarget { + /** + * List of health statuses of the services on this target. Only present for target types \"server\" and \"ip\". + */ + 'healthStatus'?: Array; + 'server'?: LoadBalancerTargetServer; + /** + * Type of the resource. Here always \"server\". + */ + 'type'?: string; + /** + * Use the private network IP instead of the public IP. Only present for target types \"server\" and \"label_selector\". + */ + 'usePrivateIp'?: boolean = false; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "healthStatus", + "baseName": "health_status", + "type": "Array" + }, + { + "name": "server", + "baseName": "server", + "type": "LoadBalancerTargetServer" + }, + { + "name": "type", + "baseName": "type", + "type": "string" + }, + { + "name": "usePrivateIp", + "baseName": "use_private_ip", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerTargetTarget.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancerTypesGet200Response.ts b/ts_openapi/model/loadBalancerTypesGet200Response.ts new file mode 100644 index 0000000..966067f --- /dev/null +++ b/ts_openapi/model/loadBalancerTypesGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancerTypesGet200ResponseLoadBalancerTypesInner } from './loadBalancerTypesGet200ResponseLoadBalancerTypesInner'; + +export class LoadBalancerTypesGet200Response { + 'loadBalancerTypes': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "loadBalancerTypes", + "baseName": "load_balancer_types", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerTypesGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancerTypesGet200ResponseLoadBalancerTypesInner.ts b/ts_openapi/model/loadBalancerTypesGet200ResponseLoadBalancerTypesInner.ts new file mode 100644 index 0000000..fc314ec --- /dev/null +++ b/ts_openapi/model/loadBalancerTypesGet200ResponseLoadBalancerTypesInner.ts @@ -0,0 +1,107 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInner } from './loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInner'; + +export class LoadBalancerTypesGet200ResponseLoadBalancerTypesInner { + /** + * Point in time when the Load Balancer type is deprecated (in ISO-8601 format) + */ + 'deprecated': string | null; + /** + * Description of the Load Balancer type + */ + 'description': string; + /** + * ID of the Load Balancer type + */ + 'id': number; + /** + * Number of SSL Certificates that can be assigned to a single Load Balancer + */ + 'maxAssignedCertificates': number; + /** + * Number of maximum simultaneous open connections + */ + 'maxConnections': number; + /** + * Number of services a Load Balancer of this type can have + */ + 'maxServices': number; + /** + * Number of targets a single Load Balancer can have + */ + 'maxTargets': number; + /** + * Unique identifier of the Load Balancer type + */ + 'name': string; + /** + * Prices in different network zones + */ + 'prices': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "deprecated", + "baseName": "deprecated", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "maxAssignedCertificates", + "baseName": "max_assigned_certificates", + "type": "number" + }, + { + "name": "maxConnections", + "baseName": "max_connections", + "type": "number" + }, + { + "name": "maxServices", + "baseName": "max_services", + "type": "number" + }, + { + "name": "maxTargets", + "baseName": "max_targets", + "type": "number" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "prices", + "baseName": "prices", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerTypesGet200ResponseLoadBalancerTypesInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInner.ts b/ts_openapi/model/loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInner.ts new file mode 100644 index 0000000..1a5f42b --- /dev/null +++ b/ts_openapi/model/loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInner.ts @@ -0,0 +1,48 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly } from './loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly'; +import { LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly } from './loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly'; + +export class LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInner { + /** + * Name of the Location the price is for + */ + 'location': string; + 'priceHourly': LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly; + 'priceMonthly': LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "location", + "baseName": "location", + "type": "string" + }, + { + "name": "priceHourly", + "baseName": "price_hourly", + "type": "LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly" + }, + { + "name": "priceMonthly", + "baseName": "price_monthly", + "type": "LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly.ts b/ts_openapi/model/loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly.ts new file mode 100644 index 0000000..2e645bb --- /dev/null +++ b/ts_openapi/model/loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Hourly costs for a Resource in this Location +*/ +export class LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly { + /** + * Price with VAT added + */ + 'gross': string; + /** + * Price without VAT + */ + 'net': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "gross", + "baseName": "gross", + "type": "string" + }, + { + "name": "net", + "baseName": "net", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly.ts b/ts_openapi/model/loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly.ts new file mode 100644 index 0000000..639d815 --- /dev/null +++ b/ts_openapi/model/loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Monthly costs for a Resource in this Location +*/ +export class LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly { + /** + * Price with VAT added + */ + 'gross': string; + /** + * Price without VAT + */ + 'net': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "gross", + "baseName": "gross", + "type": "string" + }, + { + "name": "net", + "baseName": "net", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancerTypesIdGet200Response.ts b/ts_openapi/model/loadBalancerTypesIdGet200Response.ts new file mode 100644 index 0000000..f75fc20 --- /dev/null +++ b/ts_openapi/model/loadBalancerTypesIdGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancerTypesGet200ResponseLoadBalancerTypesInner } from './loadBalancerTypesGet200ResponseLoadBalancerTypesInner'; + +export class LoadBalancerTypesIdGet200Response { + 'loadBalancerType'?: LoadBalancerTypesGet200ResponseLoadBalancerTypesInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "loadBalancerType", + "baseName": "load_balancer_type", + "type": "LoadBalancerTypesGet200ResponseLoadBalancerTypesInner" + } ]; + + static getAttributeTypeMap() { + return LoadBalancerTypesIdGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersGet200Response.ts b/ts_openapi/model/loadBalancersGet200Response.ts new file mode 100644 index 0000000..15b340f --- /dev/null +++ b/ts_openapi/model/loadBalancersGet200Response.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { LoadBalancersGet200ResponseLoadBalancersInner } from './loadBalancersGet200ResponseLoadBalancersInner'; + +export class LoadBalancersGet200Response { + 'loadBalancers': Array; + 'meta'?: ActionsResponseMeta; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "loadBalancers", + "baseName": "load_balancers", + "type": "Array" + }, + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInner.ts b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInner.ts new file mode 100644 index 0000000..61bd979 --- /dev/null +++ b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInner.ts @@ -0,0 +1,153 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FloatingIpsGet200ResponseFloatingIpsInnerProtection } from './floatingIpsGet200ResponseFloatingIpsInnerProtection'; +import { LoadBalancerService } from './loadBalancerService'; +import { LoadBalancerTarget } from './loadBalancerTarget'; +import { LoadBalancerTypesGet200ResponseLoadBalancerTypesInner } from './loadBalancerTypesGet200ResponseLoadBalancerTypesInner'; +import { LoadBalancersGet200ResponseLoadBalancersInnerAlgorithm } from './loadBalancersGet200ResponseLoadBalancersInnerAlgorithm'; +import { LoadBalancersGet200ResponseLoadBalancersInnerLocation } from './loadBalancersGet200ResponseLoadBalancersInnerLocation'; +import { LoadBalancersGet200ResponseLoadBalancersInnerPrivateNetInner } from './loadBalancersGet200ResponseLoadBalancersInnerPrivateNetInner'; +import { LoadBalancersGet200ResponseLoadBalancersInnerPublicNet } from './loadBalancersGet200ResponseLoadBalancersInnerPublicNet'; + +export class LoadBalancersGet200ResponseLoadBalancersInner { + 'algorithm': LoadBalancersGet200ResponseLoadBalancersInnerAlgorithm; + /** + * Point in time when the Resource was created (in ISO-8601 format) + */ + 'created': string; + /** + * ID of the Resource + */ + 'id': number; + /** + * Free Traffic for the current billing period in bytes + */ + 'includedTraffic': number; + /** + * Inbound Traffic for the current billing period in bytes + */ + 'ingoingTraffic': number | null; + /** + * User-defined labels (key-value pairs) + */ + 'labels': { [key: string]: string; }; + 'loadBalancerType': LoadBalancerTypesGet200ResponseLoadBalancerTypesInner; + 'location': LoadBalancersGet200ResponseLoadBalancersInnerLocation; + /** + * Name of the Resource. Must be unique per Project. + */ + 'name': string; + /** + * Outbound Traffic for the current billing period in bytes + */ + 'outgoingTraffic': number | null; + /** + * Private networks information + */ + 'privateNet': Array; + 'protection': FloatingIpsGet200ResponseFloatingIpsInnerProtection; + 'publicNet': LoadBalancersGet200ResponseLoadBalancersInnerPublicNet; + /** + * List of services that belong to this Load Balancer + */ + 'services': Array; + /** + * List of targets that belong to this Load Balancer + */ + 'targets': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "algorithm", + "baseName": "algorithm", + "type": "LoadBalancersGet200ResponseLoadBalancersInnerAlgorithm" + }, + { + "name": "created", + "baseName": "created", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "includedTraffic", + "baseName": "included_traffic", + "type": "number" + }, + { + "name": "ingoingTraffic", + "baseName": "ingoing_traffic", + "type": "number" + }, + { + "name": "labels", + "baseName": "labels", + "type": "{ [key: string]: string; }" + }, + { + "name": "loadBalancerType", + "baseName": "load_balancer_type", + "type": "LoadBalancerTypesGet200ResponseLoadBalancerTypesInner" + }, + { + "name": "location", + "baseName": "location", + "type": "LoadBalancersGet200ResponseLoadBalancersInnerLocation" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "outgoingTraffic", + "baseName": "outgoing_traffic", + "type": "number" + }, + { + "name": "privateNet", + "baseName": "private_net", + "type": "Array" + }, + { + "name": "protection", + "baseName": "protection", + "type": "FloatingIpsGet200ResponseFloatingIpsInnerProtection" + }, + { + "name": "publicNet", + "baseName": "public_net", + "type": "LoadBalancersGet200ResponseLoadBalancersInnerPublicNet" + }, + { + "name": "services", + "baseName": "services", + "type": "Array" + }, + { + "name": "targets", + "baseName": "targets", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersGet200ResponseLoadBalancersInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerAlgorithm.ts b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerAlgorithm.ts new file mode 100644 index 0000000..e8be536 --- /dev/null +++ b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerAlgorithm.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Algorithm of the Load Balancer +*/ +export class LoadBalancersGet200ResponseLoadBalancersInnerAlgorithm { + /** + * Type of the algorithm + */ + 'type': LoadBalancersGet200ResponseLoadBalancersInnerAlgorithm.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "LoadBalancersGet200ResponseLoadBalancersInnerAlgorithm.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersGet200ResponseLoadBalancersInnerAlgorithm.attributeTypeMap; + } +} + +export namespace LoadBalancersGet200ResponseLoadBalancersInnerAlgorithm { + export enum TypeEnum { + RoundRobin = 'round_robin', + LeastConnections = 'least_connections' + } +} diff --git a/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerLocation.ts b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerLocation.ts new file mode 100644 index 0000000..340efd5 --- /dev/null +++ b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerLocation.ts @@ -0,0 +1,97 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class LoadBalancersGet200ResponseLoadBalancersInnerLocation { + /** + * City the Location is closest to + */ + 'city': string; + /** + * ISO 3166-1 alpha-2 code of the country the Location resides in + */ + 'country': string; + /** + * Description of the Location + */ + 'description': string; + /** + * ID of the Location + */ + 'id': number; + /** + * Latitude of the city closest to the Location + */ + 'latitude': number; + /** + * Longitude of the city closest to the Location + */ + 'longitude': number; + /** + * Unique identifier of the Location + */ + 'name': string; + /** + * Name of network zone this Location resides in + */ + 'networkZone': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "city", + "baseName": "city", + "type": "string" + }, + { + "name": "country", + "baseName": "country", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "latitude", + "baseName": "latitude", + "type": "number" + }, + { + "name": "longitude", + "baseName": "longitude", + "type": "number" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "networkZone", + "baseName": "network_zone", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersGet200ResponseLoadBalancersInnerLocation.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerPrivateNetInner.ts b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerPrivateNetInner.ts new file mode 100644 index 0000000..5904aa4 --- /dev/null +++ b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerPrivateNetInner.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class LoadBalancersGet200ResponseLoadBalancersInnerPrivateNetInner { + /** + * IP address (v4) of this Load Balancer in this Network + */ + 'ip'?: string; + /** + * ID of the Network + */ + 'network'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "ip", + "baseName": "ip", + "type": "string" + }, + { + "name": "network", + "baseName": "network", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersGet200ResponseLoadBalancersInnerPrivateNetInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerPublicNet.ts b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerPublicNet.ts new file mode 100644 index 0000000..18c1d04 --- /dev/null +++ b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerPublicNet.ts @@ -0,0 +1,51 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4 } from './loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4'; +import { LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6 } from './loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6'; + +/** +* Public network information +*/ +export class LoadBalancersGet200ResponseLoadBalancersInnerPublicNet { + /** + * Public Interface enabled or not + */ + 'enabled': boolean; + 'ipv4': LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4; + 'ipv6': LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "enabled", + "baseName": "enabled", + "type": "boolean" + }, + { + "name": "ipv4", + "baseName": "ipv4", + "type": "LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4" + }, + { + "name": "ipv6", + "baseName": "ipv6", + "type": "LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersGet200ResponseLoadBalancersInnerPublicNet.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4.ts b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4.ts new file mode 100644 index 0000000..0a53781 --- /dev/null +++ b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* IP address (v4) +*/ +export class LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4 { + /** + * Reverse DNS PTR entry for the IPv4 address of this Load Balancer + */ + 'dnsPtr'?: string | null; + /** + * IP address (v4) of this Load Balancer + */ + 'ip'?: string | null; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "dnsPtr", + "baseName": "dns_ptr", + "type": "string" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6.ts b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6.ts new file mode 100644 index 0000000..88a82e6 --- /dev/null +++ b/ts_openapi/model/loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* IP address (v6) +*/ +export class LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6 { + /** + * Reverse DNS PTR entry for the IPv6 address of this Load Balancer + */ + 'dnsPtr'?: string | null; + /** + * IP address (v6) of this Load Balancer + */ + 'ip'?: string | null; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "dnsPtr", + "baseName": "dns_ptr", + "type": "string" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersIdActionsAttachToNetworkPostRequest.ts b/ts_openapi/model/loadBalancersIdActionsAttachToNetworkPostRequest.ts new file mode 100644 index 0000000..51a147e --- /dev/null +++ b/ts_openapi/model/loadBalancersIdActionsAttachToNetworkPostRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class LoadBalancersIdActionsAttachToNetworkPostRequest { + /** + * IP to request to be assigned to this Load Balancer; if you do not provide this then you will be auto assigned an IP address + */ + 'ip'?: string; + /** + * ID of an existing network to attach the Load Balancer to + */ + 'network': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "ip", + "baseName": "ip", + "type": "string" + }, + { + "name": "network", + "baseName": "network", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersIdActionsAttachToNetworkPostRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersIdActionsChangeAlgorithmPostRequest.ts b/ts_openapi/model/loadBalancersIdActionsChangeAlgorithmPostRequest.ts new file mode 100644 index 0000000..4eda9bc --- /dev/null +++ b/ts_openapi/model/loadBalancersIdActionsChangeAlgorithmPostRequest.ts @@ -0,0 +1,40 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class LoadBalancersIdActionsChangeAlgorithmPostRequest { + /** + * Algorithm of the Load Balancer + */ + 'type': LoadBalancersIdActionsChangeAlgorithmPostRequest.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "LoadBalancersIdActionsChangeAlgorithmPostRequest.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersIdActionsChangeAlgorithmPostRequest.attributeTypeMap; + } +} + +export namespace LoadBalancersIdActionsChangeAlgorithmPostRequest { + export enum TypeEnum { + RoundRobin = 'round_robin', + LeastConnections = 'least_connections' + } +} diff --git a/ts_openapi/model/loadBalancersIdActionsChangeProtectionPostRequest.ts b/ts_openapi/model/loadBalancersIdActionsChangeProtectionPostRequest.ts new file mode 100644 index 0000000..301d365 --- /dev/null +++ b/ts_openapi/model/loadBalancersIdActionsChangeProtectionPostRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class LoadBalancersIdActionsChangeProtectionPostRequest { + /** + * If true, prevents the Load Balancer from being deleted + */ + '_delete'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "_delete", + "baseName": "delete", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersIdActionsChangeProtectionPostRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersIdActionsDeleteServicePostRequest.ts b/ts_openapi/model/loadBalancersIdActionsDeleteServicePostRequest.ts new file mode 100644 index 0000000..9c04564 --- /dev/null +++ b/ts_openapi/model/loadBalancersIdActionsDeleteServicePostRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class LoadBalancersIdActionsDeleteServicePostRequest { + /** + * The listen port of the service you want to delete + */ + 'listenPort': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "listenPort", + "baseName": "listen_port", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersIdActionsDeleteServicePostRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersIdActionsDetachFromNetworkPostRequest.ts b/ts_openapi/model/loadBalancersIdActionsDetachFromNetworkPostRequest.ts new file mode 100644 index 0000000..aa0daab --- /dev/null +++ b/ts_openapi/model/loadBalancersIdActionsDetachFromNetworkPostRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class LoadBalancersIdActionsDetachFromNetworkPostRequest { + /** + * ID of an existing network to detach the Load Balancer from + */ + 'network': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "network", + "baseName": "network", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersIdActionsDetachFromNetworkPostRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersIdGet200Response.ts b/ts_openapi/model/loadBalancersIdGet200Response.ts new file mode 100644 index 0000000..67c0e7a --- /dev/null +++ b/ts_openapi/model/loadBalancersIdGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancersGet200ResponseLoadBalancersInner } from './loadBalancersGet200ResponseLoadBalancersInner'; + +export class LoadBalancersIdGet200Response { + 'loadBalancer': LoadBalancersGet200ResponseLoadBalancersInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "loadBalancer", + "baseName": "load_balancer", + "type": "LoadBalancersGet200ResponseLoadBalancersInner" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersIdGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersIdMetricsGet200Response.ts b/ts_openapi/model/loadBalancersIdMetricsGet200Response.ts new file mode 100644 index 0000000..271803e --- /dev/null +++ b/ts_openapi/model/loadBalancersIdMetricsGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancersIdMetricsGet200ResponseMetrics } from './loadBalancersIdMetricsGet200ResponseMetrics'; + +export class LoadBalancersIdMetricsGet200Response { + 'metrics': LoadBalancersIdMetricsGet200ResponseMetrics; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "metrics", + "baseName": "metrics", + "type": "LoadBalancersIdMetricsGet200ResponseMetrics" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersIdMetricsGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersIdMetricsGet200ResponseMetrics.ts b/ts_openapi/model/loadBalancersIdMetricsGet200ResponseMetrics.ts new file mode 100644 index 0000000..2961b2c --- /dev/null +++ b/ts_openapi/model/loadBalancersIdMetricsGet200ResponseMetrics.ts @@ -0,0 +1,62 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue } from './loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue'; + +export class LoadBalancersIdMetricsGet200ResponseMetrics { + /** + * End of period of metrics reported (in ISO-8601 format) + */ + 'end': string; + /** + * Start of period of metrics reported (in ISO-8601 format) + */ + 'start': string; + /** + * Resolution of results in seconds. + */ + 'step': number; + /** + * Hash with timeseries information, containing the name of timeseries as key + */ + 'timeSeries': { [key: string]: LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue; }; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "end", + "baseName": "end", + "type": "string" + }, + { + "name": "start", + "baseName": "start", + "type": "string" + }, + { + "name": "step", + "baseName": "step", + "type": "number" + }, + { + "name": "timeSeries", + "baseName": "time_series", + "type": "{ [key: string]: LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue; }" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersIdMetricsGet200ResponseMetrics.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue.ts b/ts_openapi/model/loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue.ts new file mode 100644 index 0000000..3717bf4 --- /dev/null +++ b/ts_openapi/model/loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue.ts @@ -0,0 +1,35 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValueValuesInnerInner } from './loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValueValuesInnerInner'; + +export class LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue { + /** + * Metrics Timestamps with values + */ + 'values': Array>; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "values", + "baseName": "values", + "type": "Array>" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValueValuesInnerInner.ts b/ts_openapi/model/loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValueValuesInnerInner.ts new file mode 100644 index 0000000..9bae715 --- /dev/null +++ b/ts_openapi/model/loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValueValuesInnerInner.ts @@ -0,0 +1,26 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValueValuesInnerInner { + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + ]; + + static getAttributeTypeMap() { + return LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValueValuesInnerInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersIdPutRequest.ts b/ts_openapi/model/loadBalancersIdPutRequest.ts new file mode 100644 index 0000000..8bd5de1 --- /dev/null +++ b/ts_openapi/model/loadBalancersIdPutRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class LoadBalancersIdPutRequest { + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * New Load Balancer name + */ + 'name'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersIdPutRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/loadBalancersPost201Response.ts b/ts_openapi/model/loadBalancersPost201Response.ts new file mode 100644 index 0000000..662935f --- /dev/null +++ b/ts_openapi/model/loadBalancersPost201Response.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; +import { LoadBalancersGet200ResponseLoadBalancersInner } from './loadBalancersGet200ResponseLoadBalancersInner'; + +export class LoadBalancersPost201Response { + 'action': Action; + 'loadBalancer': LoadBalancersGet200ResponseLoadBalancersInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "action", + "baseName": "action", + "type": "Action" + }, + { + "name": "loadBalancer", + "baseName": "load_balancer", + "type": "LoadBalancersGet200ResponseLoadBalancersInner" + } ]; + + static getAttributeTypeMap() { + return LoadBalancersPost201Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/locationsGet200Response.ts b/ts_openapi/model/locationsGet200Response.ts new file mode 100644 index 0000000..596f5ae --- /dev/null +++ b/ts_openapi/model/locationsGet200Response.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { LoadBalancersGet200ResponseLoadBalancersInnerLocation } from './loadBalancersGet200ResponseLoadBalancersInnerLocation'; + +export class LocationsGet200Response { + 'locations': Array; + 'meta': ActionsResponseMeta; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "locations", + "baseName": "locations", + "type": "Array" + }, + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + } ]; + + static getAttributeTypeMap() { + return LocationsGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/locationsIdGet200Response.ts b/ts_openapi/model/locationsIdGet200Response.ts new file mode 100644 index 0000000..88d9f14 --- /dev/null +++ b/ts_openapi/model/locationsIdGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancersGet200ResponseLoadBalancersInnerLocation } from './loadBalancersGet200ResponseLoadBalancersInnerLocation'; + +export class LocationsIdGet200Response { + 'location': LoadBalancersGet200ResponseLoadBalancersInnerLocation; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "location", + "baseName": "location", + "type": "LoadBalancersGet200ResponseLoadBalancersInnerLocation" + } ]; + + static getAttributeTypeMap() { + return LocationsIdGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/models.ts b/ts_openapi/model/models.ts new file mode 100644 index 0000000..082f43c --- /dev/null +++ b/ts_openapi/model/models.ts @@ -0,0 +1,956 @@ +import localVarRequest from 'request'; + +export * from './action'; +export * from './actionError'; +export * from './actionResourcesInner'; +export * from './actionResponse'; +export * from './actionsResponse'; +export * from './actionsResponseMeta'; +export * from './actionsResponseMetaPagination'; +export * from './addDeleteRouteRequest'; +export * from './addSubnetRequest'; +export * from './addTargetRequest'; +export * from './addTargetRequestLabelSelector'; +export * from './addTargetRequestServer'; +export * from './addToPlacementGroupRequest'; +export * from './applyToResourcesRequest'; +export * from './assignFloatingIPRequest'; +export * from './assignPrimaryIPRequest'; +export * from './attachToNetworkRequest'; +export * from './attachVolumeRequest'; +export * from './certificate'; +export * from './certificateResponse'; +export * from './certificateStatus'; +export * from './certificateStatusError'; +export * from './certificateUsedByInner'; +export * from './certificatesResponse'; +export * from './changeDNSPTRRequest'; +export * from './changeIPRangeRequest'; +export * from './changeLoadbalancerDnsPtrRequest'; +export * from './changeProtectionRequest'; +export * from './changeProtectionRequest1'; +export * from './changeProtectionRequest2'; +export * from './changeTypeRequest'; +export * from './createCertificateRequest'; +export * from './createCertificateResponse'; +export * from './createFirewallRequest'; +export * from './createFirewallRequestApplyToInner'; +export * from './createFirewallRequestApplyToInnerLabelSelector'; +export * from './createFirewallRequestApplyToInnerServer'; +export * from './createFirewallResponse'; +export * from './createFloatingIPRequest'; +export * from './createImageRequest'; +export * from './createLoadBalancerRequest'; +export * from './createLoadBalancerRequestLabels'; +export * from './createNetworkRequest'; +export * from './createNetworkRequestSubnetsInner'; +export * from './createPlacementGroupRequest'; +export * from './createPlacementGroupResponse'; +export * from './createPrimaryIPRequest'; +export * from './createPrimaryIPResponse'; +export * from './createServerRequest'; +export * from './createServerRequestFirewallsInner'; +export * from './createServerRequestPublicNet'; +export * from './createServerResponse'; +export * from './createVolumeRequest'; +export * from './datacentersGet200Response'; +export * from './datacentersGet200ResponseDatacentersInner'; +export * from './datacentersGet200ResponseDatacentersInnerLocation'; +export * from './datacentersGet200ResponseDatacentersInnerServerTypes'; +export * from './datacentersIdGet200Response'; +export * from './deleteSubnetRequest'; +export * from './deprecationInfo'; +export * from './detachFromNetworkRequest'; +export * from './firewall'; +export * from './firewallAppliedToInner'; +export * from './firewallAppliedToInnerAppliedToResourcesInner'; +export * from './firewallAppliedToInnerAppliedToResourcesInnerServer'; +export * from './firewallAppliedToInnerLabelSelector'; +export * from './firewallApplyToResources'; +export * from './firewallApplyToResourcesLabelSelector'; +export * from './firewallApplyToResourcesServer'; +export * from './firewallRemoveFromResources'; +export * from './firewallResponse'; +export * from './firewallsResponse'; +export * from './floatingIpsGet200Response'; +export * from './floatingIpsGet200ResponseFloatingIpsInner'; +export * from './floatingIpsGet200ResponseFloatingIpsInnerDnsPtrInner'; +export * from './floatingIpsGet200ResponseFloatingIpsInnerHomeLocation'; +export * from './floatingIpsGet200ResponseFloatingIpsInnerProtection'; +export * from './floatingIpsIdActionsGet200Response'; +export * from './floatingIpsIdGet200Response'; +export * from './floatingIpsPost201Response'; +export * from './imagesGet200Response'; +export * from './imagesGet200ResponseImagesInner'; +export * from './imagesGet200ResponseImagesInnerCreatedFrom'; +export * from './imagesIdActionsChangeProtectionPostRequest'; +export * from './imagesIdGet200Response'; +export * from './isosGet200Response'; +export * from './isosGet200ResponseIsosInner'; +export * from './isosIdGet200Response'; +export * from './loadBalancerAlgorithm'; +export * from './loadBalancerService'; +export * from './loadBalancerServiceHTTP'; +export * from './loadBalancerServiceHTTP1'; +export * from './loadBalancerServiceHealthCheck'; +export * from './loadBalancerServiceHealthCheckHttp'; +export * from './loadBalancerTarget'; +export * from './loadBalancerTargetHealthStatusInner'; +export * from './loadBalancerTargetIP'; +export * from './loadBalancerTargetLabelSelector'; +export * from './loadBalancerTargetServer'; +export * from './loadBalancerTargetTarget'; +export * from './loadBalancerTypesGet200Response'; +export * from './loadBalancerTypesGet200ResponseLoadBalancerTypesInner'; +export * from './loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInner'; +export * from './loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly'; +export * from './loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly'; +export * from './loadBalancerTypesIdGet200Response'; +export * from './loadBalancersGet200Response'; +export * from './loadBalancersGet200ResponseLoadBalancersInner'; +export * from './loadBalancersGet200ResponseLoadBalancersInnerAlgorithm'; +export * from './loadBalancersGet200ResponseLoadBalancersInnerLocation'; +export * from './loadBalancersGet200ResponseLoadBalancersInnerPrivateNetInner'; +export * from './loadBalancersGet200ResponseLoadBalancersInnerPublicNet'; +export * from './loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4'; +export * from './loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6'; +export * from './loadBalancersIdActionsAttachToNetworkPostRequest'; +export * from './loadBalancersIdActionsChangeAlgorithmPostRequest'; +export * from './loadBalancersIdActionsChangeProtectionPostRequest'; +export * from './loadBalancersIdActionsDeleteServicePostRequest'; +export * from './loadBalancersIdActionsDetachFromNetworkPostRequest'; +export * from './loadBalancersIdGet200Response'; +export * from './loadBalancersIdMetricsGet200Response'; +export * from './loadBalancersIdMetricsGet200ResponseMetrics'; +export * from './loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue'; +export * from './loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValueValuesInnerInner'; +export * from './loadBalancersIdPutRequest'; +export * from './loadBalancersPost201Response'; +export * from './locationsGet200Response'; +export * from './locationsIdGet200Response'; +export * from './networksGet200Response'; +export * from './networksGet200ResponseNetworksInner'; +export * from './networksGet200ResponseNetworksInnerProtection'; +export * from './networksGet200ResponseNetworksInnerRoutesInner'; +export * from './networksGet200ResponseNetworksInnerSubnetsInner'; +export * from './networksPost201Response'; +export * from './nullableAction'; +export * from './placementGroup'; +export * from './placementGroupNullable'; +export * from './placementGroupResponse'; +export * from './placementGroupsResponse'; +export * from './pricingGet200Response'; +export * from './pricingGet200ResponsePricing'; +export * from './pricingGet200ResponsePricingFloatingIp'; +export * from './pricingGet200ResponsePricingFloatingIpPriceMonthly'; +export * from './pricingGet200ResponsePricingFloatingIpsInner'; +export * from './pricingGet200ResponsePricingFloatingIpsInnerPricesInner'; +export * from './pricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly'; +export * from './pricingGet200ResponsePricingImage'; +export * from './pricingGet200ResponsePricingLoadBalancerTypesInner'; +export * from './pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInner'; +export * from './pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly'; +export * from './pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly'; +export * from './pricingGet200ResponsePricingPrimaryIpsInner'; +export * from './pricingGet200ResponsePricingPrimaryIpsInnerPricesInner'; +export * from './pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly'; +export * from './pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly'; +export * from './pricingGet200ResponsePricingServerBackup'; +export * from './pricingGet200ResponsePricingServerTypesInner'; +export * from './pricingGet200ResponsePricingServerTypesInnerPricesInner'; +export * from './pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly'; +export * from './pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly'; +export * from './pricingGet200ResponsePricingTraffic'; +export * from './pricingGet200ResponsePricingVolume'; +export * from './primaryIP'; +export * from './primaryIPDatacenter'; +export * from './primaryIPDnsPtrInner'; +export * from './primaryIPResponse'; +export * from './primaryIPsResponse'; +export * from './rebuildServerRequest'; +export * from './removeFromResourcesRequest'; +export * from './removeTargetRequest'; +export * from './rule'; +export * from './serverPublicNetFirewall'; +export * from './serverTypesGet200Response'; +export * from './serverTypesGet200ResponseServerTypesInner'; +export * from './serverTypesIdGet200Response'; +export * from './serversGet200Response'; +export * from './serversGet200ResponseServersInner'; +export * from './serversGet200ResponseServersInnerDatacenter'; +export * from './serversGet200ResponseServersInnerImage'; +export * from './serversGet200ResponseServersInnerIso'; +export * from './serversGet200ResponseServersInnerPrivateNetInner'; +export * from './serversGet200ResponseServersInnerProtection'; +export * from './serversGet200ResponseServersInnerPublicNet'; +export * from './serversGet200ResponseServersInnerPublicNetIpv4'; +export * from './serversGet200ResponseServersInnerPublicNetIpv6'; +export * from './serversGet200ResponseServersInnerPublicNetIpv6DnsPtrInner'; +export * from './serversGet200ResponseServersInnerServerType'; +export * from './serversIdActionsAttachIsoPostRequest'; +export * from './serversIdActionsChangeAliasIpsPostRequest'; +export * from './serversIdActionsChangeDnsPtrPostRequest'; +export * from './serversIdActionsChangeProtectionPostRequest'; +export * from './serversIdActionsChangeTypePostRequest'; +export * from './serversIdActionsCreateImagePost201Response'; +export * from './serversIdActionsEnableRescuePost201Response'; +export * from './serversIdActionsEnableRescuePostRequest'; +export * from './serversIdActionsRebuildPost201Response'; +export * from './serversIdActionsRequestConsolePost201Response'; +export * from './serversIdDelete200Response'; +export * from './serversIdGet200Response'; +export * from './setRulesRequest'; +export * from './sshKeysGet200Response'; +export * from './sshKeysGet200ResponseSshKeysInner'; +export * from './sshKeysIdPutRequest'; +export * from './sshKeysPost201Response'; +export * from './sshKeysPostRequest'; +export * from './updateCertificateRequest'; +export * from './updateFirewallRequest'; +export * from './updateFloatingIPRequest'; +export * from './updateImageRequest'; +export * from './updateLoadBalancerService'; +export * from './updateLoadBalancerServiceHealthCheck'; +export * from './updateLoadBalancerServiceHealthCheckHttp'; +export * from './updateNetworkRequest'; +export * from './updateNetworkRequestLabels'; +export * from './updatePlacementGroupRequest'; +export * from './updatePrimaryIPRequest'; +export * from './updateServerRequest'; +export * from './updateVolumeRequest'; +export * from './volumesGet200Response'; +export * from './volumesGet200ResponseVolumesInner'; +export * from './volumesGet200ResponseVolumesInnerLocation'; +export * from './volumesIdActionsChangeProtectionPostRequest'; +export * from './volumesIdActionsResizePostRequest'; +export * from './volumesIdGet200Response'; +export * from './volumesPost201Response'; + +import * as fs from 'fs'; + +export interface RequestDetailedFile { + value: Buffer; + options?: { + filename?: string; + contentType?: string; + } +} + +export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile; + + +import { Action } from './action'; +import { ActionError } from './actionError'; +import { ActionResourcesInner } from './actionResourcesInner'; +import { ActionResponse } from './actionResponse'; +import { ActionsResponse } from './actionsResponse'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { ActionsResponseMetaPagination } from './actionsResponseMetaPagination'; +import { AddDeleteRouteRequest } from './addDeleteRouteRequest'; +import { AddSubnetRequest } from './addSubnetRequest'; +import { AddTargetRequest } from './addTargetRequest'; +import { AddTargetRequestLabelSelector } from './addTargetRequestLabelSelector'; +import { AddTargetRequestServer } from './addTargetRequestServer'; +import { AddToPlacementGroupRequest } from './addToPlacementGroupRequest'; +import { ApplyToResourcesRequest } from './applyToResourcesRequest'; +import { AssignFloatingIPRequest } from './assignFloatingIPRequest'; +import { AssignPrimaryIPRequest } from './assignPrimaryIPRequest'; +import { AttachToNetworkRequest } from './attachToNetworkRequest'; +import { AttachVolumeRequest } from './attachVolumeRequest'; +import { Certificate } from './certificate'; +import { CertificateResponse } from './certificateResponse'; +import { CertificateStatus } from './certificateStatus'; +import { CertificateStatusError } from './certificateStatusError'; +import { CertificateUsedByInner } from './certificateUsedByInner'; +import { CertificatesResponse } from './certificatesResponse'; +import { ChangeDNSPTRRequest } from './changeDNSPTRRequest'; +import { ChangeIPRangeRequest } from './changeIPRangeRequest'; +import { ChangeLoadbalancerDnsPtrRequest } from './changeLoadbalancerDnsPtrRequest'; +import { ChangeProtectionRequest } from './changeProtectionRequest'; +import { ChangeProtectionRequest1 } from './changeProtectionRequest1'; +import { ChangeProtectionRequest2 } from './changeProtectionRequest2'; +import { ChangeTypeRequest } from './changeTypeRequest'; +import { CreateCertificateRequest } from './createCertificateRequest'; +import { CreateCertificateResponse } from './createCertificateResponse'; +import { CreateFirewallRequest } from './createFirewallRequest'; +import { CreateFirewallRequestApplyToInner } from './createFirewallRequestApplyToInner'; +import { CreateFirewallRequestApplyToInnerLabelSelector } from './createFirewallRequestApplyToInnerLabelSelector'; +import { CreateFirewallRequestApplyToInnerServer } from './createFirewallRequestApplyToInnerServer'; +import { CreateFirewallResponse } from './createFirewallResponse'; +import { CreateFloatingIPRequest } from './createFloatingIPRequest'; +import { CreateImageRequest } from './createImageRequest'; +import { CreateLoadBalancerRequest } from './createLoadBalancerRequest'; +import { CreateLoadBalancerRequestLabels } from './createLoadBalancerRequestLabels'; +import { CreateNetworkRequest } from './createNetworkRequest'; +import { CreateNetworkRequestSubnetsInner } from './createNetworkRequestSubnetsInner'; +import { CreatePlacementGroupRequest } from './createPlacementGroupRequest'; +import { CreatePlacementGroupResponse } from './createPlacementGroupResponse'; +import { CreatePrimaryIPRequest } from './createPrimaryIPRequest'; +import { CreatePrimaryIPResponse } from './createPrimaryIPResponse'; +import { CreateServerRequest } from './createServerRequest'; +import { CreateServerRequestFirewallsInner } from './createServerRequestFirewallsInner'; +import { CreateServerRequestPublicNet } from './createServerRequestPublicNet'; +import { CreateServerResponse } from './createServerResponse'; +import { CreateVolumeRequest } from './createVolumeRequest'; +import { DatacentersGet200Response } from './datacentersGet200Response'; +import { DatacentersGet200ResponseDatacentersInner } from './datacentersGet200ResponseDatacentersInner'; +import { DatacentersGet200ResponseDatacentersInnerLocation } from './datacentersGet200ResponseDatacentersInnerLocation'; +import { DatacentersGet200ResponseDatacentersInnerServerTypes } from './datacentersGet200ResponseDatacentersInnerServerTypes'; +import { DatacentersIdGet200Response } from './datacentersIdGet200Response'; +import { DeleteSubnetRequest } from './deleteSubnetRequest'; +import { DeprecationInfo } from './deprecationInfo'; +import { DetachFromNetworkRequest } from './detachFromNetworkRequest'; +import { Firewall } from './firewall'; +import { FirewallAppliedToInner } from './firewallAppliedToInner'; +import { FirewallAppliedToInnerAppliedToResourcesInner } from './firewallAppliedToInnerAppliedToResourcesInner'; +import { FirewallAppliedToInnerAppliedToResourcesInnerServer } from './firewallAppliedToInnerAppliedToResourcesInnerServer'; +import { FirewallAppliedToInnerLabelSelector } from './firewallAppliedToInnerLabelSelector'; +import { FirewallApplyToResources } from './firewallApplyToResources'; +import { FirewallApplyToResourcesLabelSelector } from './firewallApplyToResourcesLabelSelector'; +import { FirewallApplyToResourcesServer } from './firewallApplyToResourcesServer'; +import { FirewallRemoveFromResources } from './firewallRemoveFromResources'; +import { FirewallResponse } from './firewallResponse'; +import { FirewallsResponse } from './firewallsResponse'; +import { FloatingIpsGet200Response } from './floatingIpsGet200Response'; +import { FloatingIpsGet200ResponseFloatingIpsInner } from './floatingIpsGet200ResponseFloatingIpsInner'; +import { FloatingIpsGet200ResponseFloatingIpsInnerDnsPtrInner } from './floatingIpsGet200ResponseFloatingIpsInnerDnsPtrInner'; +import { FloatingIpsGet200ResponseFloatingIpsInnerHomeLocation } from './floatingIpsGet200ResponseFloatingIpsInnerHomeLocation'; +import { FloatingIpsGet200ResponseFloatingIpsInnerProtection } from './floatingIpsGet200ResponseFloatingIpsInnerProtection'; +import { FloatingIpsIdActionsGet200Response } from './floatingIpsIdActionsGet200Response'; +import { FloatingIpsIdGet200Response } from './floatingIpsIdGet200Response'; +import { FloatingIpsPost201Response } from './floatingIpsPost201Response'; +import { ImagesGet200Response } from './imagesGet200Response'; +import { ImagesGet200ResponseImagesInner } from './imagesGet200ResponseImagesInner'; +import { ImagesGet200ResponseImagesInnerCreatedFrom } from './imagesGet200ResponseImagesInnerCreatedFrom'; +import { ImagesIdActionsChangeProtectionPostRequest } from './imagesIdActionsChangeProtectionPostRequest'; +import { ImagesIdGet200Response } from './imagesIdGet200Response'; +import { IsosGet200Response } from './isosGet200Response'; +import { IsosGet200ResponseIsosInner } from './isosGet200ResponseIsosInner'; +import { IsosIdGet200Response } from './isosIdGet200Response'; +import { LoadBalancerAlgorithm } from './loadBalancerAlgorithm'; +import { LoadBalancerService } from './loadBalancerService'; +import { LoadBalancerServiceHTTP } from './loadBalancerServiceHTTP'; +import { LoadBalancerServiceHTTP1 } from './loadBalancerServiceHTTP1'; +import { LoadBalancerServiceHealthCheck } from './loadBalancerServiceHealthCheck'; +import { LoadBalancerServiceHealthCheckHttp } from './loadBalancerServiceHealthCheckHttp'; +import { LoadBalancerTarget } from './loadBalancerTarget'; +import { LoadBalancerTargetHealthStatusInner } from './loadBalancerTargetHealthStatusInner'; +import { LoadBalancerTargetIP } from './loadBalancerTargetIP'; +import { LoadBalancerTargetLabelSelector } from './loadBalancerTargetLabelSelector'; +import { LoadBalancerTargetServer } from './loadBalancerTargetServer'; +import { LoadBalancerTargetTarget } from './loadBalancerTargetTarget'; +import { LoadBalancerTypesGet200Response } from './loadBalancerTypesGet200Response'; +import { LoadBalancerTypesGet200ResponseLoadBalancerTypesInner } from './loadBalancerTypesGet200ResponseLoadBalancerTypesInner'; +import { LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInner } from './loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInner'; +import { LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly } from './loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly'; +import { LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly } from './loadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly'; +import { LoadBalancerTypesIdGet200Response } from './loadBalancerTypesIdGet200Response'; +import { LoadBalancersGet200Response } from './loadBalancersGet200Response'; +import { LoadBalancersGet200ResponseLoadBalancersInner } from './loadBalancersGet200ResponseLoadBalancersInner'; +import { LoadBalancersGet200ResponseLoadBalancersInnerAlgorithm } from './loadBalancersGet200ResponseLoadBalancersInnerAlgorithm'; +import { LoadBalancersGet200ResponseLoadBalancersInnerLocation } from './loadBalancersGet200ResponseLoadBalancersInnerLocation'; +import { LoadBalancersGet200ResponseLoadBalancersInnerPrivateNetInner } from './loadBalancersGet200ResponseLoadBalancersInnerPrivateNetInner'; +import { LoadBalancersGet200ResponseLoadBalancersInnerPublicNet } from './loadBalancersGet200ResponseLoadBalancersInnerPublicNet'; +import { LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4 } from './loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4'; +import { LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6 } from './loadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6'; +import { LoadBalancersIdActionsAttachToNetworkPostRequest } from './loadBalancersIdActionsAttachToNetworkPostRequest'; +import { LoadBalancersIdActionsChangeAlgorithmPostRequest } from './loadBalancersIdActionsChangeAlgorithmPostRequest'; +import { LoadBalancersIdActionsChangeProtectionPostRequest } from './loadBalancersIdActionsChangeProtectionPostRequest'; +import { LoadBalancersIdActionsDeleteServicePostRequest } from './loadBalancersIdActionsDeleteServicePostRequest'; +import { LoadBalancersIdActionsDetachFromNetworkPostRequest } from './loadBalancersIdActionsDetachFromNetworkPostRequest'; +import { LoadBalancersIdGet200Response } from './loadBalancersIdGet200Response'; +import { LoadBalancersIdMetricsGet200Response } from './loadBalancersIdMetricsGet200Response'; +import { LoadBalancersIdMetricsGet200ResponseMetrics } from './loadBalancersIdMetricsGet200ResponseMetrics'; +import { LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue } from './loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue'; +import { LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValueValuesInnerInner } from './loadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValueValuesInnerInner'; +import { LoadBalancersIdPutRequest } from './loadBalancersIdPutRequest'; +import { LoadBalancersPost201Response } from './loadBalancersPost201Response'; +import { LocationsGet200Response } from './locationsGet200Response'; +import { LocationsIdGet200Response } from './locationsIdGet200Response'; +import { NetworksGet200Response } from './networksGet200Response'; +import { NetworksGet200ResponseNetworksInner } from './networksGet200ResponseNetworksInner'; +import { NetworksGet200ResponseNetworksInnerProtection } from './networksGet200ResponseNetworksInnerProtection'; +import { NetworksGet200ResponseNetworksInnerRoutesInner } from './networksGet200ResponseNetworksInnerRoutesInner'; +import { NetworksGet200ResponseNetworksInnerSubnetsInner } from './networksGet200ResponseNetworksInnerSubnetsInner'; +import { NetworksPost201Response } from './networksPost201Response'; +import { NullableAction } from './nullableAction'; +import { PlacementGroup } from './placementGroup'; +import { PlacementGroupNullable } from './placementGroupNullable'; +import { PlacementGroupResponse } from './placementGroupResponse'; +import { PlacementGroupsResponse } from './placementGroupsResponse'; +import { PricingGet200Response } from './pricingGet200Response'; +import { PricingGet200ResponsePricing } from './pricingGet200ResponsePricing'; +import { PricingGet200ResponsePricingFloatingIp } from './pricingGet200ResponsePricingFloatingIp'; +import { PricingGet200ResponsePricingFloatingIpPriceMonthly } from './pricingGet200ResponsePricingFloatingIpPriceMonthly'; +import { PricingGet200ResponsePricingFloatingIpsInner } from './pricingGet200ResponsePricingFloatingIpsInner'; +import { PricingGet200ResponsePricingFloatingIpsInnerPricesInner } from './pricingGet200ResponsePricingFloatingIpsInnerPricesInner'; +import { PricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly } from './pricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly'; +import { PricingGet200ResponsePricingImage } from './pricingGet200ResponsePricingImage'; +import { PricingGet200ResponsePricingLoadBalancerTypesInner } from './pricingGet200ResponsePricingLoadBalancerTypesInner'; +import { PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInner } from './pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInner'; +import { PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly } from './pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly'; +import { PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly } from './pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly'; +import { PricingGet200ResponsePricingPrimaryIpsInner } from './pricingGet200ResponsePricingPrimaryIpsInner'; +import { PricingGet200ResponsePricingPrimaryIpsInnerPricesInner } from './pricingGet200ResponsePricingPrimaryIpsInnerPricesInner'; +import { PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly } from './pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly'; +import { PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly } from './pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly'; +import { PricingGet200ResponsePricingServerBackup } from './pricingGet200ResponsePricingServerBackup'; +import { PricingGet200ResponsePricingServerTypesInner } from './pricingGet200ResponsePricingServerTypesInner'; +import { PricingGet200ResponsePricingServerTypesInnerPricesInner } from './pricingGet200ResponsePricingServerTypesInnerPricesInner'; +import { PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly } from './pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly'; +import { PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly } from './pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly'; +import { PricingGet200ResponsePricingTraffic } from './pricingGet200ResponsePricingTraffic'; +import { PricingGet200ResponsePricingVolume } from './pricingGet200ResponsePricingVolume'; +import { PrimaryIP } from './primaryIP'; +import { PrimaryIPDatacenter } from './primaryIPDatacenter'; +import { PrimaryIPDnsPtrInner } from './primaryIPDnsPtrInner'; +import { PrimaryIPResponse } from './primaryIPResponse'; +import { PrimaryIPsResponse } from './primaryIPsResponse'; +import { RebuildServerRequest } from './rebuildServerRequest'; +import { RemoveFromResourcesRequest } from './removeFromResourcesRequest'; +import { RemoveTargetRequest } from './removeTargetRequest'; +import { Rule } from './rule'; +import { ServerPublicNetFirewall } from './serverPublicNetFirewall'; +import { ServerTypesGet200Response } from './serverTypesGet200Response'; +import { ServerTypesGet200ResponseServerTypesInner } from './serverTypesGet200ResponseServerTypesInner'; +import { ServerTypesIdGet200Response } from './serverTypesIdGet200Response'; +import { ServersGet200Response } from './serversGet200Response'; +import { ServersGet200ResponseServersInner } from './serversGet200ResponseServersInner'; +import { ServersGet200ResponseServersInnerDatacenter } from './serversGet200ResponseServersInnerDatacenter'; +import { ServersGet200ResponseServersInnerImage } from './serversGet200ResponseServersInnerImage'; +import { ServersGet200ResponseServersInnerIso } from './serversGet200ResponseServersInnerIso'; +import { ServersGet200ResponseServersInnerPrivateNetInner } from './serversGet200ResponseServersInnerPrivateNetInner'; +import { ServersGet200ResponseServersInnerProtection } from './serversGet200ResponseServersInnerProtection'; +import { ServersGet200ResponseServersInnerPublicNet } from './serversGet200ResponseServersInnerPublicNet'; +import { ServersGet200ResponseServersInnerPublicNetIpv4 } from './serversGet200ResponseServersInnerPublicNetIpv4'; +import { ServersGet200ResponseServersInnerPublicNetIpv6 } from './serversGet200ResponseServersInnerPublicNetIpv6'; +import { ServersGet200ResponseServersInnerPublicNetIpv6DnsPtrInner } from './serversGet200ResponseServersInnerPublicNetIpv6DnsPtrInner'; +import { ServersGet200ResponseServersInnerServerType } from './serversGet200ResponseServersInnerServerType'; +import { ServersIdActionsAttachIsoPostRequest } from './serversIdActionsAttachIsoPostRequest'; +import { ServersIdActionsChangeAliasIpsPostRequest } from './serversIdActionsChangeAliasIpsPostRequest'; +import { ServersIdActionsChangeDnsPtrPostRequest } from './serversIdActionsChangeDnsPtrPostRequest'; +import { ServersIdActionsChangeProtectionPostRequest } from './serversIdActionsChangeProtectionPostRequest'; +import { ServersIdActionsChangeTypePostRequest } from './serversIdActionsChangeTypePostRequest'; +import { ServersIdActionsCreateImagePost201Response } from './serversIdActionsCreateImagePost201Response'; +import { ServersIdActionsEnableRescuePost201Response } from './serversIdActionsEnableRescuePost201Response'; +import { ServersIdActionsEnableRescuePostRequest } from './serversIdActionsEnableRescuePostRequest'; +import { ServersIdActionsRebuildPost201Response } from './serversIdActionsRebuildPost201Response'; +import { ServersIdActionsRequestConsolePost201Response } from './serversIdActionsRequestConsolePost201Response'; +import { ServersIdDelete200Response } from './serversIdDelete200Response'; +import { ServersIdGet200Response } from './serversIdGet200Response'; +import { SetRulesRequest } from './setRulesRequest'; +import { SshKeysGet200Response } from './sshKeysGet200Response'; +import { SshKeysGet200ResponseSshKeysInner } from './sshKeysGet200ResponseSshKeysInner'; +import { SshKeysIdPutRequest } from './sshKeysIdPutRequest'; +import { SshKeysPost201Response } from './sshKeysPost201Response'; +import { SshKeysPostRequest } from './sshKeysPostRequest'; +import { UpdateCertificateRequest } from './updateCertificateRequest'; +import { UpdateFirewallRequest } from './updateFirewallRequest'; +import { UpdateFloatingIPRequest } from './updateFloatingIPRequest'; +import { UpdateImageRequest } from './updateImageRequest'; +import { UpdateLoadBalancerService } from './updateLoadBalancerService'; +import { UpdateLoadBalancerServiceHealthCheck } from './updateLoadBalancerServiceHealthCheck'; +import { UpdateLoadBalancerServiceHealthCheckHttp } from './updateLoadBalancerServiceHealthCheckHttp'; +import { UpdateNetworkRequest } from './updateNetworkRequest'; +import { UpdateNetworkRequestLabels } from './updateNetworkRequestLabels'; +import { UpdatePlacementGroupRequest } from './updatePlacementGroupRequest'; +import { UpdatePrimaryIPRequest } from './updatePrimaryIPRequest'; +import { UpdateServerRequest } from './updateServerRequest'; +import { UpdateVolumeRequest } from './updateVolumeRequest'; +import { VolumesGet200Response } from './volumesGet200Response'; +import { VolumesGet200ResponseVolumesInner } from './volumesGet200ResponseVolumesInner'; +import { VolumesGet200ResponseVolumesInnerLocation } from './volumesGet200ResponseVolumesInnerLocation'; +import { VolumesIdActionsChangeProtectionPostRequest } from './volumesIdActionsChangeProtectionPostRequest'; +import { VolumesIdActionsResizePostRequest } from './volumesIdActionsResizePostRequest'; +import { VolumesIdGet200Response } from './volumesIdGet200Response'; +import { VolumesPost201Response } from './volumesPost201Response'; + +/* tslint:disable:no-unused-variable */ +let primitives = [ + "string", + "boolean", + "double", + "integer", + "long", + "float", + "number", + "any" + ]; + +let enumsMap: {[index: string]: any} = { + "Action.StatusEnum": Action.StatusEnum, + "AddSubnetRequest.TypeEnum": AddSubnetRequest.TypeEnum, + "AddTargetRequest.TypeEnum": AddTargetRequest.TypeEnum, + "AssignPrimaryIPRequest.AssigneeTypeEnum": AssignPrimaryIPRequest.AssigneeTypeEnum, + "Certificate.TypeEnum": Certificate.TypeEnum, + "CertificateStatus.IssuanceEnum": CertificateStatus.IssuanceEnum, + "CertificateStatus.RenewalEnum": CertificateStatus.RenewalEnum, + "CreateCertificateRequest.TypeEnum": CreateCertificateRequest.TypeEnum, + "CreateFirewallRequestApplyToInner.TypeEnum": CreateFirewallRequestApplyToInner.TypeEnum, + "CreateFloatingIPRequest.TypeEnum": CreateFloatingIPRequest.TypeEnum, + "CreateImageRequest.TypeEnum": CreateImageRequest.TypeEnum, + "CreateNetworkRequestSubnetsInner.TypeEnum": CreateNetworkRequestSubnetsInner.TypeEnum, + "CreatePlacementGroupRequest.TypeEnum": CreatePlacementGroupRequest.TypeEnum, + "CreatePrimaryIPRequest.AssigneeTypeEnum": CreatePrimaryIPRequest.AssigneeTypeEnum, + "CreatePrimaryIPRequest.TypeEnum": CreatePrimaryIPRequest.TypeEnum, + "FirewallAppliedToInner.TypeEnum": FirewallAppliedToInner.TypeEnum, + "FirewallAppliedToInnerAppliedToResourcesInner.TypeEnum": FirewallAppliedToInnerAppliedToResourcesInner.TypeEnum, + "FirewallApplyToResources.TypeEnum": FirewallApplyToResources.TypeEnum, + "FirewallRemoveFromResources.TypeEnum": FirewallRemoveFromResources.TypeEnum, + "FloatingIpsGet200ResponseFloatingIpsInner.TypeEnum": FloatingIpsGet200ResponseFloatingIpsInner.TypeEnum, + "ImagesGet200ResponseImagesInner.ArchitectureEnum": ImagesGet200ResponseImagesInner.ArchitectureEnum, + "ImagesGet200ResponseImagesInner.OsFlavorEnum": ImagesGet200ResponseImagesInner.OsFlavorEnum, + "ImagesGet200ResponseImagesInner.StatusEnum": ImagesGet200ResponseImagesInner.StatusEnum, + "ImagesGet200ResponseImagesInner.TypeEnum": ImagesGet200ResponseImagesInner.TypeEnum, + "IsosGet200ResponseIsosInner.ArchitectureEnum": IsosGet200ResponseIsosInner.ArchitectureEnum, + "IsosGet200ResponseIsosInner.TypeEnum": IsosGet200ResponseIsosInner.TypeEnum, + "LoadBalancerAlgorithm.TypeEnum": LoadBalancerAlgorithm.TypeEnum, + "LoadBalancerService.ProtocolEnum": LoadBalancerService.ProtocolEnum, + "LoadBalancerServiceHealthCheck.ProtocolEnum": LoadBalancerServiceHealthCheck.ProtocolEnum, + "LoadBalancerTarget.TypeEnum": LoadBalancerTarget.TypeEnum, + "LoadBalancerTargetHealthStatusInner.StatusEnum": LoadBalancerTargetHealthStatusInner.StatusEnum, + "LoadBalancersGet200ResponseLoadBalancersInnerAlgorithm.TypeEnum": LoadBalancersGet200ResponseLoadBalancersInnerAlgorithm.TypeEnum, + "LoadBalancersIdActionsChangeAlgorithmPostRequest.TypeEnum": LoadBalancersIdActionsChangeAlgorithmPostRequest.TypeEnum, + "NetworksGet200ResponseNetworksInnerSubnetsInner.TypeEnum": NetworksGet200ResponseNetworksInnerSubnetsInner.TypeEnum, + "NullableAction.StatusEnum": NullableAction.StatusEnum, + "PlacementGroup.TypeEnum": PlacementGroup.TypeEnum, + "PlacementGroupNullable.TypeEnum": PlacementGroupNullable.TypeEnum, + "PricingGet200ResponsePricingFloatingIpsInner.TypeEnum": PricingGet200ResponsePricingFloatingIpsInner.TypeEnum, + "PricingGet200ResponsePricingPrimaryIpsInner.TypeEnum": PricingGet200ResponsePricingPrimaryIpsInner.TypeEnum, + "PrimaryIP.AssigneeTypeEnum": PrimaryIP.AssigneeTypeEnum, + "PrimaryIP.TypeEnum": PrimaryIP.TypeEnum, + "RemoveTargetRequest.TypeEnum": RemoveTargetRequest.TypeEnum, + "Rule.DirectionEnum": Rule.DirectionEnum, + "Rule.ProtocolEnum": Rule.ProtocolEnum, + "ServerPublicNetFirewall.StatusEnum": ServerPublicNetFirewall.StatusEnum, + "ServerTypesGet200ResponseServerTypesInner.ArchitectureEnum": ServerTypesGet200ResponseServerTypesInner.ArchitectureEnum, + "ServerTypesGet200ResponseServerTypesInner.CpuTypeEnum": ServerTypesGet200ResponseServerTypesInner.CpuTypeEnum, + "ServerTypesGet200ResponseServerTypesInner.StorageTypeEnum": ServerTypesGet200ResponseServerTypesInner.StorageTypeEnum, + "ServersGet200ResponseServersInner.StatusEnum": ServersGet200ResponseServersInner.StatusEnum, + "ServersGet200ResponseServersInnerImage.ArchitectureEnum": ServersGet200ResponseServersInnerImage.ArchitectureEnum, + "ServersGet200ResponseServersInnerImage.OsFlavorEnum": ServersGet200ResponseServersInnerImage.OsFlavorEnum, + "ServersGet200ResponseServersInnerImage.StatusEnum": ServersGet200ResponseServersInnerImage.StatusEnum, + "ServersGet200ResponseServersInnerImage.TypeEnum": ServersGet200ResponseServersInnerImage.TypeEnum, + "ServersGet200ResponseServersInnerIso.ArchitectureEnum": ServersGet200ResponseServersInnerIso.ArchitectureEnum, + "ServersGet200ResponseServersInnerIso.TypeEnum": ServersGet200ResponseServersInnerIso.TypeEnum, + "ServersGet200ResponseServersInnerServerType.CpuTypeEnum": ServersGet200ResponseServersInnerServerType.CpuTypeEnum, + "ServersGet200ResponseServersInnerServerType.StorageTypeEnum": ServersGet200ResponseServersInnerServerType.StorageTypeEnum, + "ServersIdActionsEnableRescuePostRequest.TypeEnum": ServersIdActionsEnableRescuePostRequest.TypeEnum, + "UpdateImageRequest.TypeEnum": UpdateImageRequest.TypeEnum, + "UpdateLoadBalancerService.ProtocolEnum": UpdateLoadBalancerService.ProtocolEnum, + "UpdateLoadBalancerServiceHealthCheck.ProtocolEnum": UpdateLoadBalancerServiceHealthCheck.ProtocolEnum, + "VolumesGet200ResponseVolumesInner.StatusEnum": VolumesGet200ResponseVolumesInner.StatusEnum, +} + +let typeMap: {[index: string]: any} = { + "Action": Action, + "ActionError": ActionError, + "ActionResourcesInner": ActionResourcesInner, + "ActionResponse": ActionResponse, + "ActionsResponse": ActionsResponse, + "ActionsResponseMeta": ActionsResponseMeta, + "ActionsResponseMetaPagination": ActionsResponseMetaPagination, + "AddDeleteRouteRequest": AddDeleteRouteRequest, + "AddSubnetRequest": AddSubnetRequest, + "AddTargetRequest": AddTargetRequest, + "AddTargetRequestLabelSelector": AddTargetRequestLabelSelector, + "AddTargetRequestServer": AddTargetRequestServer, + "AddToPlacementGroupRequest": AddToPlacementGroupRequest, + "ApplyToResourcesRequest": ApplyToResourcesRequest, + "AssignFloatingIPRequest": AssignFloatingIPRequest, + "AssignPrimaryIPRequest": AssignPrimaryIPRequest, + "AttachToNetworkRequest": AttachToNetworkRequest, + "AttachVolumeRequest": AttachVolumeRequest, + "Certificate": Certificate, + "CertificateResponse": CertificateResponse, + "CertificateStatus": CertificateStatus, + "CertificateStatusError": CertificateStatusError, + "CertificateUsedByInner": CertificateUsedByInner, + "CertificatesResponse": CertificatesResponse, + "ChangeDNSPTRRequest": ChangeDNSPTRRequest, + "ChangeIPRangeRequest": ChangeIPRangeRequest, + "ChangeLoadbalancerDnsPtrRequest": ChangeLoadbalancerDnsPtrRequest, + "ChangeProtectionRequest": ChangeProtectionRequest, + "ChangeProtectionRequest1": ChangeProtectionRequest1, + "ChangeProtectionRequest2": ChangeProtectionRequest2, + "ChangeTypeRequest": ChangeTypeRequest, + "CreateCertificateRequest": CreateCertificateRequest, + "CreateCertificateResponse": CreateCertificateResponse, + "CreateFirewallRequest": CreateFirewallRequest, + "CreateFirewallRequestApplyToInner": CreateFirewallRequestApplyToInner, + "CreateFirewallRequestApplyToInnerLabelSelector": CreateFirewallRequestApplyToInnerLabelSelector, + "CreateFirewallRequestApplyToInnerServer": CreateFirewallRequestApplyToInnerServer, + "CreateFirewallResponse": CreateFirewallResponse, + "CreateFloatingIPRequest": CreateFloatingIPRequest, + "CreateImageRequest": CreateImageRequest, + "CreateLoadBalancerRequest": CreateLoadBalancerRequest, + "CreateLoadBalancerRequestLabels": CreateLoadBalancerRequestLabels, + "CreateNetworkRequest": CreateNetworkRequest, + "CreateNetworkRequestSubnetsInner": CreateNetworkRequestSubnetsInner, + "CreatePlacementGroupRequest": CreatePlacementGroupRequest, + "CreatePlacementGroupResponse": CreatePlacementGroupResponse, + "CreatePrimaryIPRequest": CreatePrimaryIPRequest, + "CreatePrimaryIPResponse": CreatePrimaryIPResponse, + "CreateServerRequest": CreateServerRequest, + "CreateServerRequestFirewallsInner": CreateServerRequestFirewallsInner, + "CreateServerRequestPublicNet": CreateServerRequestPublicNet, + "CreateServerResponse": CreateServerResponse, + "CreateVolumeRequest": CreateVolumeRequest, + "DatacentersGet200Response": DatacentersGet200Response, + "DatacentersGet200ResponseDatacentersInner": DatacentersGet200ResponseDatacentersInner, + "DatacentersGet200ResponseDatacentersInnerLocation": DatacentersGet200ResponseDatacentersInnerLocation, + "DatacentersGet200ResponseDatacentersInnerServerTypes": DatacentersGet200ResponseDatacentersInnerServerTypes, + "DatacentersIdGet200Response": DatacentersIdGet200Response, + "DeleteSubnetRequest": DeleteSubnetRequest, + "DeprecationInfo": DeprecationInfo, + "DetachFromNetworkRequest": DetachFromNetworkRequest, + "Firewall": Firewall, + "FirewallAppliedToInner": FirewallAppliedToInner, + "FirewallAppliedToInnerAppliedToResourcesInner": FirewallAppliedToInnerAppliedToResourcesInner, + "FirewallAppliedToInnerAppliedToResourcesInnerServer": FirewallAppliedToInnerAppliedToResourcesInnerServer, + "FirewallAppliedToInnerLabelSelector": FirewallAppliedToInnerLabelSelector, + "FirewallApplyToResources": FirewallApplyToResources, + "FirewallApplyToResourcesLabelSelector": FirewallApplyToResourcesLabelSelector, + "FirewallApplyToResourcesServer": FirewallApplyToResourcesServer, + "FirewallRemoveFromResources": FirewallRemoveFromResources, + "FirewallResponse": FirewallResponse, + "FirewallsResponse": FirewallsResponse, + "FloatingIpsGet200Response": FloatingIpsGet200Response, + "FloatingIpsGet200ResponseFloatingIpsInner": FloatingIpsGet200ResponseFloatingIpsInner, + "FloatingIpsGet200ResponseFloatingIpsInnerDnsPtrInner": FloatingIpsGet200ResponseFloatingIpsInnerDnsPtrInner, + "FloatingIpsGet200ResponseFloatingIpsInnerHomeLocation": FloatingIpsGet200ResponseFloatingIpsInnerHomeLocation, + "FloatingIpsGet200ResponseFloatingIpsInnerProtection": FloatingIpsGet200ResponseFloatingIpsInnerProtection, + "FloatingIpsIdActionsGet200Response": FloatingIpsIdActionsGet200Response, + "FloatingIpsIdGet200Response": FloatingIpsIdGet200Response, + "FloatingIpsPost201Response": FloatingIpsPost201Response, + "ImagesGet200Response": ImagesGet200Response, + "ImagesGet200ResponseImagesInner": ImagesGet200ResponseImagesInner, + "ImagesGet200ResponseImagesInnerCreatedFrom": ImagesGet200ResponseImagesInnerCreatedFrom, + "ImagesIdActionsChangeProtectionPostRequest": ImagesIdActionsChangeProtectionPostRequest, + "ImagesIdGet200Response": ImagesIdGet200Response, + "IsosGet200Response": IsosGet200Response, + "IsosGet200ResponseIsosInner": IsosGet200ResponseIsosInner, + "IsosIdGet200Response": IsosIdGet200Response, + "LoadBalancerAlgorithm": LoadBalancerAlgorithm, + "LoadBalancerService": LoadBalancerService, + "LoadBalancerServiceHTTP": LoadBalancerServiceHTTP, + "LoadBalancerServiceHTTP1": LoadBalancerServiceHTTP1, + "LoadBalancerServiceHealthCheck": LoadBalancerServiceHealthCheck, + "LoadBalancerServiceHealthCheckHttp": LoadBalancerServiceHealthCheckHttp, + "LoadBalancerTarget": LoadBalancerTarget, + "LoadBalancerTargetHealthStatusInner": LoadBalancerTargetHealthStatusInner, + "LoadBalancerTargetIP": LoadBalancerTargetIP, + "LoadBalancerTargetLabelSelector": LoadBalancerTargetLabelSelector, + "LoadBalancerTargetServer": LoadBalancerTargetServer, + "LoadBalancerTargetTarget": LoadBalancerTargetTarget, + "LoadBalancerTypesGet200Response": LoadBalancerTypesGet200Response, + "LoadBalancerTypesGet200ResponseLoadBalancerTypesInner": LoadBalancerTypesGet200ResponseLoadBalancerTypesInner, + "LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInner": LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInner, + "LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly": LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceHourly, + "LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly": LoadBalancerTypesGet200ResponseLoadBalancerTypesInnerPricesInnerPriceMonthly, + "LoadBalancerTypesIdGet200Response": LoadBalancerTypesIdGet200Response, + "LoadBalancersGet200Response": LoadBalancersGet200Response, + "LoadBalancersGet200ResponseLoadBalancersInner": LoadBalancersGet200ResponseLoadBalancersInner, + "LoadBalancersGet200ResponseLoadBalancersInnerAlgorithm": LoadBalancersGet200ResponseLoadBalancersInnerAlgorithm, + "LoadBalancersGet200ResponseLoadBalancersInnerLocation": LoadBalancersGet200ResponseLoadBalancersInnerLocation, + "LoadBalancersGet200ResponseLoadBalancersInnerPrivateNetInner": LoadBalancersGet200ResponseLoadBalancersInnerPrivateNetInner, + "LoadBalancersGet200ResponseLoadBalancersInnerPublicNet": LoadBalancersGet200ResponseLoadBalancersInnerPublicNet, + "LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4": LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv4, + "LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6": LoadBalancersGet200ResponseLoadBalancersInnerPublicNetIpv6, + "LoadBalancersIdActionsAttachToNetworkPostRequest": LoadBalancersIdActionsAttachToNetworkPostRequest, + "LoadBalancersIdActionsChangeAlgorithmPostRequest": LoadBalancersIdActionsChangeAlgorithmPostRequest, + "LoadBalancersIdActionsChangeProtectionPostRequest": LoadBalancersIdActionsChangeProtectionPostRequest, + "LoadBalancersIdActionsDeleteServicePostRequest": LoadBalancersIdActionsDeleteServicePostRequest, + "LoadBalancersIdActionsDetachFromNetworkPostRequest": LoadBalancersIdActionsDetachFromNetworkPostRequest, + "LoadBalancersIdGet200Response": LoadBalancersIdGet200Response, + "LoadBalancersIdMetricsGet200Response": LoadBalancersIdMetricsGet200Response, + "LoadBalancersIdMetricsGet200ResponseMetrics": LoadBalancersIdMetricsGet200ResponseMetrics, + "LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue": LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValue, + "LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValueValuesInnerInner": LoadBalancersIdMetricsGet200ResponseMetricsTimeSeriesValueValuesInnerInner, + "LoadBalancersIdPutRequest": LoadBalancersIdPutRequest, + "LoadBalancersPost201Response": LoadBalancersPost201Response, + "LocationsGet200Response": LocationsGet200Response, + "LocationsIdGet200Response": LocationsIdGet200Response, + "NetworksGet200Response": NetworksGet200Response, + "NetworksGet200ResponseNetworksInner": NetworksGet200ResponseNetworksInner, + "NetworksGet200ResponseNetworksInnerProtection": NetworksGet200ResponseNetworksInnerProtection, + "NetworksGet200ResponseNetworksInnerRoutesInner": NetworksGet200ResponseNetworksInnerRoutesInner, + "NetworksGet200ResponseNetworksInnerSubnetsInner": NetworksGet200ResponseNetworksInnerSubnetsInner, + "NetworksPost201Response": NetworksPost201Response, + "NullableAction": NullableAction, + "PlacementGroup": PlacementGroup, + "PlacementGroupNullable": PlacementGroupNullable, + "PlacementGroupResponse": PlacementGroupResponse, + "PlacementGroupsResponse": PlacementGroupsResponse, + "PricingGet200Response": PricingGet200Response, + "PricingGet200ResponsePricing": PricingGet200ResponsePricing, + "PricingGet200ResponsePricingFloatingIp": PricingGet200ResponsePricingFloatingIp, + "PricingGet200ResponsePricingFloatingIpPriceMonthly": PricingGet200ResponsePricingFloatingIpPriceMonthly, + "PricingGet200ResponsePricingFloatingIpsInner": PricingGet200ResponsePricingFloatingIpsInner, + "PricingGet200ResponsePricingFloatingIpsInnerPricesInner": PricingGet200ResponsePricingFloatingIpsInnerPricesInner, + "PricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly": PricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly, + "PricingGet200ResponsePricingImage": PricingGet200ResponsePricingImage, + "PricingGet200ResponsePricingLoadBalancerTypesInner": PricingGet200ResponsePricingLoadBalancerTypesInner, + "PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInner": PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInner, + "PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly": PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly, + "PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly": PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly, + "PricingGet200ResponsePricingPrimaryIpsInner": PricingGet200ResponsePricingPrimaryIpsInner, + "PricingGet200ResponsePricingPrimaryIpsInnerPricesInner": PricingGet200ResponsePricingPrimaryIpsInnerPricesInner, + "PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly": PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly, + "PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly": PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly, + "PricingGet200ResponsePricingServerBackup": PricingGet200ResponsePricingServerBackup, + "PricingGet200ResponsePricingServerTypesInner": PricingGet200ResponsePricingServerTypesInner, + "PricingGet200ResponsePricingServerTypesInnerPricesInner": PricingGet200ResponsePricingServerTypesInnerPricesInner, + "PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly": PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly, + "PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly": PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly, + "PricingGet200ResponsePricingTraffic": PricingGet200ResponsePricingTraffic, + "PricingGet200ResponsePricingVolume": PricingGet200ResponsePricingVolume, + "PrimaryIP": PrimaryIP, + "PrimaryIPDatacenter": PrimaryIPDatacenter, + "PrimaryIPDnsPtrInner": PrimaryIPDnsPtrInner, + "PrimaryIPResponse": PrimaryIPResponse, + "PrimaryIPsResponse": PrimaryIPsResponse, + "RebuildServerRequest": RebuildServerRequest, + "RemoveFromResourcesRequest": RemoveFromResourcesRequest, + "RemoveTargetRequest": RemoveTargetRequest, + "Rule": Rule, + "ServerPublicNetFirewall": ServerPublicNetFirewall, + "ServerTypesGet200Response": ServerTypesGet200Response, + "ServerTypesGet200ResponseServerTypesInner": ServerTypesGet200ResponseServerTypesInner, + "ServerTypesIdGet200Response": ServerTypesIdGet200Response, + "ServersGet200Response": ServersGet200Response, + "ServersGet200ResponseServersInner": ServersGet200ResponseServersInner, + "ServersGet200ResponseServersInnerDatacenter": ServersGet200ResponseServersInnerDatacenter, + "ServersGet200ResponseServersInnerImage": ServersGet200ResponseServersInnerImage, + "ServersGet200ResponseServersInnerIso": ServersGet200ResponseServersInnerIso, + "ServersGet200ResponseServersInnerPrivateNetInner": ServersGet200ResponseServersInnerPrivateNetInner, + "ServersGet200ResponseServersInnerProtection": ServersGet200ResponseServersInnerProtection, + "ServersGet200ResponseServersInnerPublicNet": ServersGet200ResponseServersInnerPublicNet, + "ServersGet200ResponseServersInnerPublicNetIpv4": ServersGet200ResponseServersInnerPublicNetIpv4, + "ServersGet200ResponseServersInnerPublicNetIpv6": ServersGet200ResponseServersInnerPublicNetIpv6, + "ServersGet200ResponseServersInnerPublicNetIpv6DnsPtrInner": ServersGet200ResponseServersInnerPublicNetIpv6DnsPtrInner, + "ServersGet200ResponseServersInnerServerType": ServersGet200ResponseServersInnerServerType, + "ServersIdActionsAttachIsoPostRequest": ServersIdActionsAttachIsoPostRequest, + "ServersIdActionsChangeAliasIpsPostRequest": ServersIdActionsChangeAliasIpsPostRequest, + "ServersIdActionsChangeDnsPtrPostRequest": ServersIdActionsChangeDnsPtrPostRequest, + "ServersIdActionsChangeProtectionPostRequest": ServersIdActionsChangeProtectionPostRequest, + "ServersIdActionsChangeTypePostRequest": ServersIdActionsChangeTypePostRequest, + "ServersIdActionsCreateImagePost201Response": ServersIdActionsCreateImagePost201Response, + "ServersIdActionsEnableRescuePost201Response": ServersIdActionsEnableRescuePost201Response, + "ServersIdActionsEnableRescuePostRequest": ServersIdActionsEnableRescuePostRequest, + "ServersIdActionsRebuildPost201Response": ServersIdActionsRebuildPost201Response, + "ServersIdActionsRequestConsolePost201Response": ServersIdActionsRequestConsolePost201Response, + "ServersIdDelete200Response": ServersIdDelete200Response, + "ServersIdGet200Response": ServersIdGet200Response, + "SetRulesRequest": SetRulesRequest, + "SshKeysGet200Response": SshKeysGet200Response, + "SshKeysGet200ResponseSshKeysInner": SshKeysGet200ResponseSshKeysInner, + "SshKeysIdPutRequest": SshKeysIdPutRequest, + "SshKeysPost201Response": SshKeysPost201Response, + "SshKeysPostRequest": SshKeysPostRequest, + "UpdateCertificateRequest": UpdateCertificateRequest, + "UpdateFirewallRequest": UpdateFirewallRequest, + "UpdateFloatingIPRequest": UpdateFloatingIPRequest, + "UpdateImageRequest": UpdateImageRequest, + "UpdateLoadBalancerService": UpdateLoadBalancerService, + "UpdateLoadBalancerServiceHealthCheck": UpdateLoadBalancerServiceHealthCheck, + "UpdateLoadBalancerServiceHealthCheckHttp": UpdateLoadBalancerServiceHealthCheckHttp, + "UpdateNetworkRequest": UpdateNetworkRequest, + "UpdateNetworkRequestLabels": UpdateNetworkRequestLabels, + "UpdatePlacementGroupRequest": UpdatePlacementGroupRequest, + "UpdatePrimaryIPRequest": UpdatePrimaryIPRequest, + "UpdateServerRequest": UpdateServerRequest, + "UpdateVolumeRequest": UpdateVolumeRequest, + "VolumesGet200Response": VolumesGet200Response, + "VolumesGet200ResponseVolumesInner": VolumesGet200ResponseVolumesInner, + "VolumesGet200ResponseVolumesInnerLocation": VolumesGet200ResponseVolumesInnerLocation, + "VolumesIdActionsChangeProtectionPostRequest": VolumesIdActionsChangeProtectionPostRequest, + "VolumesIdActionsResizePostRequest": VolumesIdActionsResizePostRequest, + "VolumesIdGet200Response": VolumesIdGet200Response, + "VolumesPost201Response": VolumesPost201Response, +} + +export class ObjectSerializer { + public static findCorrectType(data: any, expectedType: string) { + if (data == undefined) { + return expectedType; + } else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) { + return expectedType; + } else if (expectedType === "Date") { + return expectedType; + } else { + if (enumsMap[expectedType]) { + return expectedType; + } + + if (!typeMap[expectedType]) { + return expectedType; // w/e we don't know the type + } + + // Check the discriminator + let discriminatorProperty = typeMap[expectedType].discriminator; + if (discriminatorProperty == null) { + return expectedType; // the type does not have a discriminator. use it. + } else { + if (data[discriminatorProperty]) { + var discriminatorType = data[discriminatorProperty]; + if(typeMap[discriminatorType]){ + return discriminatorType; // use the type given in the discriminator + } else { + return expectedType; // discriminator did not map to a type + } + } else { + return expectedType; // discriminator was not present (or an empty string) + } + } + } + } + + public static serialize(data: any, type: string) { + if (data == undefined) { + return data; + } else if (primitives.indexOf(type.toLowerCase()) !== -1) { + return data; + } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 + let subType: string = type.replace("Array<", ""); // Array => Type> + subType = subType.substring(0, subType.length - 1); // Type> => Type + let transformedData: any[] = []; + for (let index = 0; index < data.length; index++) { + let datum = data[index]; + transformedData.push(ObjectSerializer.serialize(datum, subType)); + } + return transformedData; + } else if (type === "Date") { + return data.toISOString(); + } else { + if (enumsMap[type]) { + return data; + } + if (!typeMap[type]) { // in case we dont know the type + return data; + } + + // Get the actual type of this object + type = this.findCorrectType(data, type); + + // get the map for the correct type. + let attributeTypes = typeMap[type].getAttributeTypeMap(); + let instance: {[index: string]: any} = {}; + for (let index = 0; index < attributeTypes.length; index++) { + let attributeType = attributeTypes[index]; + instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type); + } + return instance; + } + } + + public static deserialize(data: any, type: string) { + // polymorphism may change the actual type. + type = ObjectSerializer.findCorrectType(data, type); + if (data == undefined) { + return data; + } else if (primitives.indexOf(type.toLowerCase()) !== -1) { + return data; + } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 + let subType: string = type.replace("Array<", ""); // Array => Type> + subType = subType.substring(0, subType.length - 1); // Type> => Type + let transformedData: any[] = []; + for (let index = 0; index < data.length; index++) { + let datum = data[index]; + transformedData.push(ObjectSerializer.deserialize(datum, subType)); + } + return transformedData; + } else if (type === "Date") { + return new Date(data); + } else { + if (enumsMap[type]) {// is Enum + return data; + } + + if (!typeMap[type]) { // dont know the type + return data; + } + let instance = new typeMap[type](); + let attributeTypes = typeMap[type].getAttributeTypeMap(); + for (let index = 0; index < attributeTypes.length; index++) { + let attributeType = attributeTypes[index]; + instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type); + } + return instance; + } + } +} + +export interface Authentication { + /** + * Apply authentication settings to header and query params. + */ + applyToRequest(requestOptions: localVarRequest.Options): Promise | void; +} + +export class HttpBasicAuth implements Authentication { + public username: string = ''; + public password: string = ''; + + applyToRequest(requestOptions: localVarRequest.Options): void { + requestOptions.auth = { + username: this.username, password: this.password + } + } +} + +export class HttpBearerAuth implements Authentication { + public accessToken: string | (() => string) = ''; + + applyToRequest(requestOptions: localVarRequest.Options): void { + if (requestOptions && requestOptions.headers) { + const accessToken = typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + requestOptions.headers["Authorization"] = "Bearer " + accessToken; + } + } +} + +export class ApiKeyAuth implements Authentication { + public apiKey: string = ''; + + constructor(private location: string, private paramName: string) { + } + + applyToRequest(requestOptions: localVarRequest.Options): void { + if (this.location == "query") { + (requestOptions.qs)[this.paramName] = this.apiKey; + } else if (this.location == "header" && requestOptions && requestOptions.headers) { + requestOptions.headers[this.paramName] = this.apiKey; + } else if (this.location == 'cookie' && requestOptions && requestOptions.headers) { + if (requestOptions.headers['Cookie']) { + requestOptions.headers['Cookie'] += '; ' + this.paramName + '=' + encodeURIComponent(this.apiKey); + } + else { + requestOptions.headers['Cookie'] = this.paramName + '=' + encodeURIComponent(this.apiKey); + } + } + } +} + +export class OAuth implements Authentication { + public accessToken: string = ''; + + applyToRequest(requestOptions: localVarRequest.Options): void { + if (requestOptions && requestOptions.headers) { + requestOptions.headers["Authorization"] = "Bearer " + this.accessToken; + } + } +} + +export class VoidAuth implements Authentication { + public username: string = ''; + public password: string = ''; + + applyToRequest(_: localVarRequest.Options): void { + // Do nothing + } +} + +export type Interceptor = (requestOptions: localVarRequest.Options) => (Promise | void); diff --git a/ts_openapi/model/networksGet200Response.ts b/ts_openapi/model/networksGet200Response.ts new file mode 100644 index 0000000..bc9d30b --- /dev/null +++ b/ts_openapi/model/networksGet200Response.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { NetworksGet200ResponseNetworksInner } from './networksGet200ResponseNetworksInner'; + +export class NetworksGet200Response { + 'meta'?: ActionsResponseMeta; + 'networks': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + }, + { + "name": "networks", + "baseName": "networks", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return NetworksGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/networksGet200ResponseNetworksInner.ts b/ts_openapi/model/networksGet200ResponseNetworksInner.ts new file mode 100644 index 0000000..693dd86 --- /dev/null +++ b/ts_openapi/model/networksGet200ResponseNetworksInner.ts @@ -0,0 +1,124 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { NetworksGet200ResponseNetworksInnerProtection } from './networksGet200ResponseNetworksInnerProtection'; +import { NetworksGet200ResponseNetworksInnerRoutesInner } from './networksGet200ResponseNetworksInnerRoutesInner'; +import { NetworksGet200ResponseNetworksInnerSubnetsInner } from './networksGet200ResponseNetworksInnerSubnetsInner'; + +export class NetworksGet200ResponseNetworksInner { + /** + * Point in time when the Network was created (in ISO-8601 format) + */ + 'created': string; + /** + * Indicates if the routes from this network should be exposed to the vSwitch connection. + */ + 'exposeRoutesToVswitch': boolean; + /** + * ID of the Network + */ + 'id': number; + /** + * IPv4 prefix of the whole Network + */ + 'ipRange': string; + /** + * User-defined labels (key-value pairs) + */ + 'labels': object; + /** + * Array of IDs of Load Balancers attached to this Network + */ + 'loadBalancers'?: Array; + /** + * Name of the Network + */ + 'name': string; + 'protection': NetworksGet200ResponseNetworksInnerProtection; + /** + * Array of routes set in this Network + */ + 'routes': Array; + /** + * Array of IDs of Servers attached to this Network + */ + 'servers': Array; + /** + * Array subnets allocated in this Network + */ + 'subnets': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "created", + "baseName": "created", + "type": "string" + }, + { + "name": "exposeRoutesToVswitch", + "baseName": "expose_routes_to_vswitch", + "type": "boolean" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "ipRange", + "baseName": "ip_range", + "type": "string" + }, + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "loadBalancers", + "baseName": "load_balancers", + "type": "Array" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "protection", + "baseName": "protection", + "type": "NetworksGet200ResponseNetworksInnerProtection" + }, + { + "name": "routes", + "baseName": "routes", + "type": "Array" + }, + { + "name": "servers", + "baseName": "servers", + "type": "Array" + }, + { + "name": "subnets", + "baseName": "subnets", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return NetworksGet200ResponseNetworksInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/networksGet200ResponseNetworksInnerProtection.ts b/ts_openapi/model/networksGet200ResponseNetworksInnerProtection.ts new file mode 100644 index 0000000..3b9715e --- /dev/null +++ b/ts_openapi/model/networksGet200ResponseNetworksInnerProtection.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Protection configuration for the Network +*/ +export class NetworksGet200ResponseNetworksInnerProtection { + /** + * If true, prevents the Network from being deleted + */ + '_delete': boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "_delete", + "baseName": "delete", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return NetworksGet200ResponseNetworksInnerProtection.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/networksGet200ResponseNetworksInnerRoutesInner.ts b/ts_openapi/model/networksGet200ResponseNetworksInnerRoutesInner.ts new file mode 100644 index 0000000..eddfb56 --- /dev/null +++ b/ts_openapi/model/networksGet200ResponseNetworksInnerRoutesInner.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class NetworksGet200ResponseNetworksInnerRoutesInner { + /** + * Destination network or host of this route. Must not overlap with an existing ip_range in any subnets or with any destinations in other routes or with the first IP of the networks ip_range or with 172.31.1.1. Must be one of the private IPv4 ranges of RFC1918. + */ + 'destination': string; + /** + * Gateway for the route. Cannot be the first IP of the networks ip_range and also cannot be 172.31.1.1 as this IP is being used as a gateway for the public network interface of Servers. + */ + 'gateway': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "destination", + "baseName": "destination", + "type": "string" + }, + { + "name": "gateway", + "baseName": "gateway", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return NetworksGet200ResponseNetworksInnerRoutesInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/networksGet200ResponseNetworksInnerSubnetsInner.ts b/ts_openapi/model/networksGet200ResponseNetworksInnerSubnetsInner.ts new file mode 100644 index 0000000..300c296 --- /dev/null +++ b/ts_openapi/model/networksGet200ResponseNetworksInnerSubnetsInner.ts @@ -0,0 +1,77 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class NetworksGet200ResponseNetworksInnerSubnetsInner { + /** + * Gateway for Servers attached to this subnet. For subnets of type Server this is always the first IP of the network IP range. + */ + 'gateway': string; + /** + * Range to allocate IPs from. Must be a Subnet of the ip_range of the parent network object and must not overlap with any other subnets or with any destinations in routes. Minimum Network size is /30. We suggest that you pick a bigger Network with a /24 netmask. + */ + 'ipRange'?: string; + /** + * Name of Network zone. The Location object contains the `network_zone` property each Location belongs to. + */ + 'networkZone': string; + /** + * Type of Subnetwork + */ + 'type': NetworksGet200ResponseNetworksInnerSubnetsInner.TypeEnum; + /** + * ID of the robot vSwitch if the subnet is of type vswitch. + */ + 'vswitchId'?: number | null; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "gateway", + "baseName": "gateway", + "type": "string" + }, + { + "name": "ipRange", + "baseName": "ip_range", + "type": "string" + }, + { + "name": "networkZone", + "baseName": "network_zone", + "type": "string" + }, + { + "name": "type", + "baseName": "type", + "type": "NetworksGet200ResponseNetworksInnerSubnetsInner.TypeEnum" + }, + { + "name": "vswitchId", + "baseName": "vswitch_id", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return NetworksGet200ResponseNetworksInnerSubnetsInner.attributeTypeMap; + } +} + +export namespace NetworksGet200ResponseNetworksInnerSubnetsInner { + export enum TypeEnum { + Cloud = 'cloud', + Server = 'server', + Vswitch = 'vswitch' + } +} diff --git a/ts_openapi/model/networksPost201Response.ts b/ts_openapi/model/networksPost201Response.ts new file mode 100644 index 0000000..96b82ca --- /dev/null +++ b/ts_openapi/model/networksPost201Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { NetworksGet200ResponseNetworksInner } from './networksGet200ResponseNetworksInner'; + +export class NetworksPost201Response { + 'network'?: NetworksGet200ResponseNetworksInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "network", + "baseName": "network", + "type": "NetworksGet200ResponseNetworksInner" + } ]; + + static getAttributeTypeMap() { + return NetworksPost201Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/nullableAction.ts b/ts_openapi/model/nullableAction.ts new file mode 100644 index 0000000..585c7af --- /dev/null +++ b/ts_openapi/model/nullableAction.ts @@ -0,0 +1,103 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionError } from './actionError'; +import { ActionResourcesInner } from './actionResourcesInner'; + +export class NullableAction { + /** + * Command executed in the Action + */ + 'command': string; + 'error': ActionError | null; + /** + * Point in time when the Action was finished (in ISO-8601 format). Only set if the Action is finished otherwise null. + */ + 'finished': string | null; + /** + * ID of the Action. Limited to 52 bits to ensure compatability with JSON double precision floats. + */ + 'id': number; + /** + * Progress of Action in percent + */ + 'progress': number; + /** + * Resources the Action relates to + */ + 'resources': Array; + /** + * Point in time when the Action was started (in ISO-8601 format) + */ + 'started': string; + /** + * Status of the Action + */ + 'status': NullableAction.StatusEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "command", + "baseName": "command", + "type": "string" + }, + { + "name": "error", + "baseName": "error", + "type": "ActionError" + }, + { + "name": "finished", + "baseName": "finished", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "progress", + "baseName": "progress", + "type": "number" + }, + { + "name": "resources", + "baseName": "resources", + "type": "Array" + }, + { + "name": "started", + "baseName": "started", + "type": "string" + }, + { + "name": "status", + "baseName": "status", + "type": "NullableAction.StatusEnum" + } ]; + + static getAttributeTypeMap() { + return NullableAction.attributeTypeMap; + } +} + +export namespace NullableAction { + export enum StatusEnum { + Success = 'success', + Running = 'running', + Error = 'error' + } +} diff --git a/ts_openapi/model/placementGroup.ts b/ts_openapi/model/placementGroup.ts new file mode 100644 index 0000000..f727eb2 --- /dev/null +++ b/ts_openapi/model/placementGroup.ts @@ -0,0 +1,84 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class PlacementGroup { + /** + * Point in time when the Resource was created (in ISO-8601 format) + */ + 'created': string; + /** + * ID of the Resource + */ + 'id': number; + /** + * User-defined labels (key-value pairs) + */ + 'labels': { [key: string]: string; }; + /** + * Name of the Resource. Must be unique per Project. + */ + 'name': string; + /** + * Array of IDs of Servers that are part of this Placement Group + */ + 'servers': Array; + /** + * Type of the Placement Group + */ + 'type': PlacementGroup.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "created", + "baseName": "created", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "labels", + "baseName": "labels", + "type": "{ [key: string]: string; }" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "servers", + "baseName": "servers", + "type": "Array" + }, + { + "name": "type", + "baseName": "type", + "type": "PlacementGroup.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return PlacementGroup.attributeTypeMap; + } +} + +export namespace PlacementGroup { + export enum TypeEnum { + Spread = 'spread' + } +} diff --git a/ts_openapi/model/placementGroupNullable.ts b/ts_openapi/model/placementGroupNullable.ts new file mode 100644 index 0000000..7df2eee --- /dev/null +++ b/ts_openapi/model/placementGroupNullable.ts @@ -0,0 +1,87 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* The placement group the server is assigned to. +*/ +export class PlacementGroupNullable { + /** + * Point in time when the Resource was created (in ISO-8601 format) + */ + 'created': string; + /** + * ID of the Resource + */ + 'id': number; + /** + * User-defined labels (key-value pairs) + */ + 'labels': { [key: string]: string; }; + /** + * Name of the Resource. Must be unique per Project. + */ + 'name': string; + /** + * Array of IDs of Servers that are part of this Placement Group + */ + 'servers': Array; + /** + * Type of the Placement Group + */ + 'type': PlacementGroupNullable.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "created", + "baseName": "created", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "labels", + "baseName": "labels", + "type": "{ [key: string]: string; }" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "servers", + "baseName": "servers", + "type": "Array" + }, + { + "name": "type", + "baseName": "type", + "type": "PlacementGroupNullable.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return PlacementGroupNullable.attributeTypeMap; + } +} + +export namespace PlacementGroupNullable { + export enum TypeEnum { + Spread = 'spread' + } +} diff --git a/ts_openapi/model/placementGroupResponse.ts b/ts_openapi/model/placementGroupResponse.ts new file mode 100644 index 0000000..f14b735 --- /dev/null +++ b/ts_openapi/model/placementGroupResponse.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PlacementGroup } from './placementGroup'; + +export class PlacementGroupResponse { + 'placementGroup': PlacementGroup; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "placementGroup", + "baseName": "placement_group", + "type": "PlacementGroup" + } ]; + + static getAttributeTypeMap() { + return PlacementGroupResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/placementGroupsResponse.ts b/ts_openapi/model/placementGroupsResponse.ts new file mode 100644 index 0000000..b058637 --- /dev/null +++ b/ts_openapi/model/placementGroupsResponse.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { PlacementGroup } from './placementGroup'; + +export class PlacementGroupsResponse { + 'meta'?: ActionsResponseMeta; + 'placementGroups': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + }, + { + "name": "placementGroups", + "baseName": "placement_groups", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return PlacementGroupsResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200Response.ts b/ts_openapi/model/pricingGet200Response.ts new file mode 100644 index 0000000..c12bad6 --- /dev/null +++ b/ts_openapi/model/pricingGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricing } from './pricingGet200ResponsePricing'; + +export class PricingGet200Response { + 'pricing': PricingGet200ResponsePricing; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "pricing", + "baseName": "pricing", + "type": "PricingGet200ResponsePricing" + } ]; + + static getAttributeTypeMap() { + return PricingGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricing.ts b/ts_openapi/model/pricingGet200ResponsePricing.ts new file mode 100644 index 0000000..1bb14be --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricing.ts @@ -0,0 +1,118 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingFloatingIp } from './pricingGet200ResponsePricingFloatingIp'; +import { PricingGet200ResponsePricingFloatingIpsInner } from './pricingGet200ResponsePricingFloatingIpsInner'; +import { PricingGet200ResponsePricingImage } from './pricingGet200ResponsePricingImage'; +import { PricingGet200ResponsePricingLoadBalancerTypesInner } from './pricingGet200ResponsePricingLoadBalancerTypesInner'; +import { PricingGet200ResponsePricingPrimaryIpsInner } from './pricingGet200ResponsePricingPrimaryIpsInner'; +import { PricingGet200ResponsePricingServerBackup } from './pricingGet200ResponsePricingServerBackup'; +import { PricingGet200ResponsePricingServerTypesInner } from './pricingGet200ResponsePricingServerTypesInner'; +import { PricingGet200ResponsePricingTraffic } from './pricingGet200ResponsePricingTraffic'; +import { PricingGet200ResponsePricingVolume } from './pricingGet200ResponsePricingVolume'; + +export class PricingGet200ResponsePricing { + /** + * Currency the returned prices are expressed in, coded according to ISO 4217 + */ + 'currency': string; + 'floatingIp': PricingGet200ResponsePricingFloatingIp; + /** + * Costs of Floating IPs types per Location and type + */ + 'floatingIps': Array; + 'image': PricingGet200ResponsePricingImage; + /** + * Costs of Load Balancer types per Location and type + */ + 'loadBalancerTypes': Array; + /** + * Costs of Primary IPs types per Location + */ + 'primaryIps': Array; + 'serverBackup': PricingGet200ResponsePricingServerBackup; + /** + * Costs of Server types per Location and type + */ + 'serverTypes': Array; + 'traffic': PricingGet200ResponsePricingTraffic; + /** + * The VAT rate used for calculating prices with VAT + */ + 'vatRate': string; + 'volume': PricingGet200ResponsePricingVolume; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "currency", + "baseName": "currency", + "type": "string" + }, + { + "name": "floatingIp", + "baseName": "floating_ip", + "type": "PricingGet200ResponsePricingFloatingIp" + }, + { + "name": "floatingIps", + "baseName": "floating_ips", + "type": "Array" + }, + { + "name": "image", + "baseName": "image", + "type": "PricingGet200ResponsePricingImage" + }, + { + "name": "loadBalancerTypes", + "baseName": "load_balancer_types", + "type": "Array" + }, + { + "name": "primaryIps", + "baseName": "primary_ips", + "type": "Array" + }, + { + "name": "serverBackup", + "baseName": "server_backup", + "type": "PricingGet200ResponsePricingServerBackup" + }, + { + "name": "serverTypes", + "baseName": "server_types", + "type": "Array" + }, + { + "name": "traffic", + "baseName": "traffic", + "type": "PricingGet200ResponsePricingTraffic" + }, + { + "name": "vatRate", + "baseName": "vat_rate", + "type": "string" + }, + { + "name": "volume", + "baseName": "volume", + "type": "PricingGet200ResponsePricingVolume" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricing.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingFloatingIp.ts b/ts_openapi/model/pricingGet200ResponsePricingFloatingIp.ts new file mode 100644 index 0000000..ab1ec0f --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingFloatingIp.ts @@ -0,0 +1,35 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingFloatingIpPriceMonthly } from './pricingGet200ResponsePricingFloatingIpPriceMonthly'; + +/** +* The cost of one Floating IP per month +*/ +export class PricingGet200ResponsePricingFloatingIp { + 'priceMonthly': PricingGet200ResponsePricingFloatingIpPriceMonthly; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "priceMonthly", + "baseName": "price_monthly", + "type": "PricingGet200ResponsePricingFloatingIpPriceMonthly" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingFloatingIp.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingFloatingIpPriceMonthly.ts b/ts_openapi/model/pricingGet200ResponsePricingFloatingIpPriceMonthly.ts new file mode 100644 index 0000000..dcbcdf6 --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingFloatingIpPriceMonthly.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class PricingGet200ResponsePricingFloatingIpPriceMonthly { + /** + * Price with VAT added + */ + 'gross': string; + /** + * Price without VAT + */ + 'net': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "gross", + "baseName": "gross", + "type": "string" + }, + { + "name": "net", + "baseName": "net", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingFloatingIpPriceMonthly.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingFloatingIpsInner.ts b/ts_openapi/model/pricingGet200ResponsePricingFloatingIpsInner.ts new file mode 100644 index 0000000..c64b47a --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingFloatingIpsInner.ts @@ -0,0 +1,50 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingFloatingIpsInnerPricesInner } from './pricingGet200ResponsePricingFloatingIpsInnerPricesInner'; + +export class PricingGet200ResponsePricingFloatingIpsInner { + /** + * Floating IP type costs per Location + */ + 'prices': Array; + /** + * The type of the Floating IP + */ + 'type': PricingGet200ResponsePricingFloatingIpsInner.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "prices", + "baseName": "prices", + "type": "Array" + }, + { + "name": "type", + "baseName": "type", + "type": "PricingGet200ResponsePricingFloatingIpsInner.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingFloatingIpsInner.attributeTypeMap; + } +} + +export namespace PricingGet200ResponsePricingFloatingIpsInner { + export enum TypeEnum { + Ipv4 = 'ipv4', + Ipv6 = 'ipv6' + } +} diff --git a/ts_openapi/model/pricingGet200ResponsePricingFloatingIpsInnerPricesInner.ts b/ts_openapi/model/pricingGet200ResponsePricingFloatingIpsInnerPricesInner.ts new file mode 100644 index 0000000..0dd5839 --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingFloatingIpsInnerPricesInner.ts @@ -0,0 +1,41 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly } from './pricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly'; + +export class PricingGet200ResponsePricingFloatingIpsInnerPricesInner { + /** + * Name of the Location the price is for + */ + 'location': string; + 'priceMonthly': PricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "location", + "baseName": "location", + "type": "string" + }, + { + "name": "priceMonthly", + "baseName": "price_monthly", + "type": "PricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingFloatingIpsInnerPricesInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly.ts b/ts_openapi/model/pricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly.ts new file mode 100644 index 0000000..5fd831a --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Monthly costs for a Floating IP type in this Location +*/ +export class PricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly { + /** + * Price with VAT added + */ + 'gross': string; + /** + * Price without VAT + */ + 'net': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "gross", + "baseName": "gross", + "type": "string" + }, + { + "name": "net", + "baseName": "net", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingFloatingIpsInnerPricesInnerPriceMonthly.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingImage.ts b/ts_openapi/model/pricingGet200ResponsePricingImage.ts new file mode 100644 index 0000000..a86ce49 --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingImage.ts @@ -0,0 +1,35 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingFloatingIpPriceMonthly } from './pricingGet200ResponsePricingFloatingIpPriceMonthly'; + +/** +* The cost of Image per GB/month +*/ +export class PricingGet200ResponsePricingImage { + 'pricePerGbMonth': PricingGet200ResponsePricingFloatingIpPriceMonthly; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "pricePerGbMonth", + "baseName": "price_per_gb_month", + "type": "PricingGet200ResponsePricingFloatingIpPriceMonthly" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingImage.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingLoadBalancerTypesInner.ts b/ts_openapi/model/pricingGet200ResponsePricingLoadBalancerTypesInner.ts new file mode 100644 index 0000000..a29d99b --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingLoadBalancerTypesInner.ts @@ -0,0 +1,53 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInner } from './pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInner'; + +export class PricingGet200ResponsePricingLoadBalancerTypesInner { + /** + * ID of the Load Balancer type the price is for + */ + 'id': number; + /** + * Name of the Load Balancer type the price is for + */ + 'name': string; + /** + * Load Balancer type costs per Location + */ + 'prices': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "prices", + "baseName": "prices", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingLoadBalancerTypesInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInner.ts b/ts_openapi/model/pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInner.ts new file mode 100644 index 0000000..03df391 --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInner.ts @@ -0,0 +1,48 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly } from './pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly'; +import { PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly } from './pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly'; + +export class PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInner { + /** + * Name of the Location the price is for + */ + 'location': string; + 'priceHourly': PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly; + 'priceMonthly': PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "location", + "baseName": "location", + "type": "string" + }, + { + "name": "priceHourly", + "baseName": "price_hourly", + "type": "PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly" + }, + { + "name": "priceMonthly", + "baseName": "price_monthly", + "type": "PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly.ts b/ts_openapi/model/pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly.ts new file mode 100644 index 0000000..a09f981 --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Hourly costs for a Load Balancer type in this network zone +*/ +export class PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly { + /** + * Price with VAT added + */ + 'gross': string; + /** + * Price without VAT + */ + 'net': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "gross", + "baseName": "gross", + "type": "string" + }, + { + "name": "net", + "baseName": "net", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceHourly.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly.ts b/ts_openapi/model/pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly.ts new file mode 100644 index 0000000..b0e55bf --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Monthly costs for a Load Balancer type in this network zone +*/ +export class PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly { + /** + * Price with VAT added + */ + 'gross': string; + /** + * Price without VAT + */ + 'net': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "gross", + "baseName": "gross", + "type": "string" + }, + { + "name": "net", + "baseName": "net", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingLoadBalancerTypesInnerPricesInnerPriceMonthly.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingPrimaryIpsInner.ts b/ts_openapi/model/pricingGet200ResponsePricingPrimaryIpsInner.ts new file mode 100644 index 0000000..e06625c --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingPrimaryIpsInner.ts @@ -0,0 +1,50 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingPrimaryIpsInnerPricesInner } from './pricingGet200ResponsePricingPrimaryIpsInnerPricesInner'; + +export class PricingGet200ResponsePricingPrimaryIpsInner { + /** + * Primary IP type costs per Location + */ + 'prices': Array; + /** + * The type of the Primary IP + */ + 'type': PricingGet200ResponsePricingPrimaryIpsInner.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "prices", + "baseName": "prices", + "type": "Array" + }, + { + "name": "type", + "baseName": "type", + "type": "PricingGet200ResponsePricingPrimaryIpsInner.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingPrimaryIpsInner.attributeTypeMap; + } +} + +export namespace PricingGet200ResponsePricingPrimaryIpsInner { + export enum TypeEnum { + Ipv4 = 'ipv4', + Ipv6 = 'ipv6' + } +} diff --git a/ts_openapi/model/pricingGet200ResponsePricingPrimaryIpsInnerPricesInner.ts b/ts_openapi/model/pricingGet200ResponsePricingPrimaryIpsInnerPricesInner.ts new file mode 100644 index 0000000..7ec42be --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingPrimaryIpsInnerPricesInner.ts @@ -0,0 +1,48 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly } from './pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly'; +import { PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly } from './pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly'; + +export class PricingGet200ResponsePricingPrimaryIpsInnerPricesInner { + /** + * Name of the Location the price is for + */ + 'location': string; + 'priceHourly': PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly; + 'priceMonthly': PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "location", + "baseName": "location", + "type": "string" + }, + { + "name": "priceHourly", + "baseName": "price_hourly", + "type": "PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly" + }, + { + "name": "priceMonthly", + "baseName": "price_monthly", + "type": "PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingPrimaryIpsInnerPricesInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly.ts b/ts_openapi/model/pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly.ts new file mode 100644 index 0000000..f6f4d05 --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Hourly costs for a Primary IP type in this Location +*/ +export class PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly { + /** + * Price with VAT added + */ + 'gross': string; + /** + * Price without VAT + */ + 'net': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "gross", + "baseName": "gross", + "type": "string" + }, + { + "name": "net", + "baseName": "net", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceHourly.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly.ts b/ts_openapi/model/pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly.ts new file mode 100644 index 0000000..071a115 --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Monthly costs for a Primary IP type in this Location +*/ +export class PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly { + /** + * Price with VAT added + */ + 'gross': string; + /** + * Price without VAT + */ + 'net': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "gross", + "baseName": "gross", + "type": "string" + }, + { + "name": "net", + "baseName": "net", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingPrimaryIpsInnerPricesInnerPriceMonthly.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingServerBackup.ts b/ts_openapi/model/pricingGet200ResponsePricingServerBackup.ts new file mode 100644 index 0000000..fcb5618 --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingServerBackup.ts @@ -0,0 +1,37 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Will increase base Server costs by specific percentage +*/ +export class PricingGet200ResponsePricingServerBackup { + /** + * Percentage by how much the base price will increase + */ + 'percentage': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "percentage", + "baseName": "percentage", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingServerBackup.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingServerTypesInner.ts b/ts_openapi/model/pricingGet200ResponsePricingServerTypesInner.ts new file mode 100644 index 0000000..328210a --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingServerTypesInner.ts @@ -0,0 +1,53 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingServerTypesInnerPricesInner } from './pricingGet200ResponsePricingServerTypesInnerPricesInner'; + +export class PricingGet200ResponsePricingServerTypesInner { + /** + * ID of the Server type the price is for + */ + 'id': number; + /** + * Name of the Server type the price is for + */ + 'name': string; + /** + * Server type costs per Location + */ + 'prices': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "prices", + "baseName": "prices", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingServerTypesInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingServerTypesInnerPricesInner.ts b/ts_openapi/model/pricingGet200ResponsePricingServerTypesInnerPricesInner.ts new file mode 100644 index 0000000..afd7fea --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingServerTypesInnerPricesInner.ts @@ -0,0 +1,48 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly } from './pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly'; +import { PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly } from './pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly'; + +export class PricingGet200ResponsePricingServerTypesInnerPricesInner { + /** + * Name of the Location the price is for + */ + 'location': string; + 'priceHourly': PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly; + 'priceMonthly': PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "location", + "baseName": "location", + "type": "string" + }, + { + "name": "priceHourly", + "baseName": "price_hourly", + "type": "PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly" + }, + { + "name": "priceMonthly", + "baseName": "price_monthly", + "type": "PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingServerTypesInnerPricesInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly.ts b/ts_openapi/model/pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly.ts new file mode 100644 index 0000000..71ffd62 --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Hourly costs for a Server type in this Location +*/ +export class PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly { + /** + * Price with VAT added + */ + 'gross': string; + /** + * Price without VAT + */ + 'net': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "gross", + "baseName": "gross", + "type": "string" + }, + { + "name": "net", + "baseName": "net", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceHourly.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly.ts b/ts_openapi/model/pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly.ts new file mode 100644 index 0000000..d2fa2b5 --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Monthly costs for a Server type in this Location +*/ +export class PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly { + /** + * Price with VAT added + */ + 'gross': string; + /** + * Price without VAT + */ + 'net': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "gross", + "baseName": "gross", + "type": "string" + }, + { + "name": "net", + "baseName": "net", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingServerTypesInnerPricesInnerPriceMonthly.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingTraffic.ts b/ts_openapi/model/pricingGet200ResponsePricingTraffic.ts new file mode 100644 index 0000000..04db6d3 --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingTraffic.ts @@ -0,0 +1,35 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingFloatingIpPriceMonthly } from './pricingGet200ResponsePricingFloatingIpPriceMonthly'; + +/** +* The cost of additional traffic per TB +*/ +export class PricingGet200ResponsePricingTraffic { + 'pricePerTb': PricingGet200ResponsePricingFloatingIpPriceMonthly; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "pricePerTb", + "baseName": "price_per_tb", + "type": "PricingGet200ResponsePricingFloatingIpPriceMonthly" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingTraffic.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/pricingGet200ResponsePricingVolume.ts b/ts_openapi/model/pricingGet200ResponsePricingVolume.ts new file mode 100644 index 0000000..4f2cad0 --- /dev/null +++ b/ts_openapi/model/pricingGet200ResponsePricingVolume.ts @@ -0,0 +1,35 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingFloatingIpPriceMonthly } from './pricingGet200ResponsePricingFloatingIpPriceMonthly'; + +/** +* The cost of Volume per GB/month +*/ +export class PricingGet200ResponsePricingVolume { + 'pricePerGbMonth': PricingGet200ResponsePricingFloatingIpPriceMonthly; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "pricePerGbMonth", + "baseName": "price_per_gb_month", + "type": "PricingGet200ResponsePricingFloatingIpPriceMonthly" + } ]; + + static getAttributeTypeMap() { + return PricingGet200ResponsePricingVolume.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/primaryIP.ts b/ts_openapi/model/primaryIP.ts new file mode 100644 index 0000000..0913222 --- /dev/null +++ b/ts_openapi/model/primaryIP.ts @@ -0,0 +1,148 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FloatingIpsGet200ResponseFloatingIpsInnerProtection } from './floatingIpsGet200ResponseFloatingIpsInnerProtection'; +import { PrimaryIPDatacenter } from './primaryIPDatacenter'; +import { PrimaryIPDnsPtrInner } from './primaryIPDnsPtrInner'; + +export class PrimaryIP { + /** + * ID of the resource the Primary IP is assigned to, null if it is not assigned at all + */ + 'assigneeId': number | null; + /** + * Resource type the Primary IP can be assigned to + */ + 'assigneeType': PrimaryIP.AssigneeTypeEnum; + /** + * Delete this Primary IP when the resource it is assigned to is deleted + */ + 'autoDelete': boolean; + /** + * Whether the IP is blocked + */ + 'blocked': boolean; + /** + * Point in time when the Resource was created (in ISO-8601 format) + */ + 'created': string; + 'datacenter': PrimaryIPDatacenter; + /** + * Array of reverse DNS entries + */ + 'dnsPtr': Array; + /** + * ID of the Resource + */ + 'id': number; + /** + * IP address + */ + 'ip': string; + /** + * User-defined labels (key-value pairs) + */ + 'labels': { [key: string]: string; }; + /** + * Name of the Resource. Must be unique per Project. + */ + 'name': string; + 'protection': FloatingIpsGet200ResponseFloatingIpsInnerProtection; + /** + * Type of the Primary IP + */ + 'type': PrimaryIP.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "assigneeId", + "baseName": "assignee_id", + "type": "number" + }, + { + "name": "assigneeType", + "baseName": "assignee_type", + "type": "PrimaryIP.AssigneeTypeEnum" + }, + { + "name": "autoDelete", + "baseName": "auto_delete", + "type": "boolean" + }, + { + "name": "blocked", + "baseName": "blocked", + "type": "boolean" + }, + { + "name": "created", + "baseName": "created", + "type": "string" + }, + { + "name": "datacenter", + "baseName": "datacenter", + "type": "PrimaryIPDatacenter" + }, + { + "name": "dnsPtr", + "baseName": "dns_ptr", + "type": "Array" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + }, + { + "name": "labels", + "baseName": "labels", + "type": "{ [key: string]: string; }" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "protection", + "baseName": "protection", + "type": "FloatingIpsGet200ResponseFloatingIpsInnerProtection" + }, + { + "name": "type", + "baseName": "type", + "type": "PrimaryIP.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return PrimaryIP.attributeTypeMap; + } +} + +export namespace PrimaryIP { + export enum AssigneeTypeEnum { + Server = 'server' + } + export enum TypeEnum { + Ipv4 = 'ipv4', + Ipv6 = 'ipv6' + } +} diff --git a/ts_openapi/model/primaryIPDatacenter.ts b/ts_openapi/model/primaryIPDatacenter.ts new file mode 100644 index 0000000..2fb7845 --- /dev/null +++ b/ts_openapi/model/primaryIPDatacenter.ts @@ -0,0 +1,69 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { DatacentersGet200ResponseDatacentersInnerLocation } from './datacentersGet200ResponseDatacentersInnerLocation'; +import { DatacentersGet200ResponseDatacentersInnerServerTypes } from './datacentersGet200ResponseDatacentersInnerServerTypes'; + +/** +* Datacenter this Primary IP is located at +*/ +export class PrimaryIPDatacenter { + /** + * Description of the Datacenter + */ + 'description': string; + /** + * ID of the Resource + */ + 'id': number; + 'location': DatacentersGet200ResponseDatacentersInnerLocation; + /** + * Unique identifier of the Datacenter + */ + 'name': string; + 'serverTypes': DatacentersGet200ResponseDatacentersInnerServerTypes; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "location", + "baseName": "location", + "type": "DatacentersGet200ResponseDatacentersInnerLocation" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "serverTypes", + "baseName": "server_types", + "type": "DatacentersGet200ResponseDatacentersInnerServerTypes" + } ]; + + static getAttributeTypeMap() { + return PrimaryIPDatacenter.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/primaryIPDnsPtrInner.ts b/ts_openapi/model/primaryIPDnsPtrInner.ts new file mode 100644 index 0000000..4122655 --- /dev/null +++ b/ts_openapi/model/primaryIPDnsPtrInner.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class PrimaryIPDnsPtrInner { + /** + * DNS pointer for the specific IP address + */ + 'dnsPtr': string; + /** + * Single IPv4 or IPv6 address + */ + 'ip': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "dnsPtr", + "baseName": "dns_ptr", + "type": "string" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return PrimaryIPDnsPtrInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/primaryIPResponse.ts b/ts_openapi/model/primaryIPResponse.ts new file mode 100644 index 0000000..c6acfa3 --- /dev/null +++ b/ts_openapi/model/primaryIPResponse.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PrimaryIP } from './primaryIP'; + +export class PrimaryIPResponse { + 'primaryIp': PrimaryIP; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "primaryIp", + "baseName": "primary_ip", + "type": "PrimaryIP" + } ]; + + static getAttributeTypeMap() { + return PrimaryIPResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/primaryIPsResponse.ts b/ts_openapi/model/primaryIPsResponse.ts new file mode 100644 index 0000000..2becd31 --- /dev/null +++ b/ts_openapi/model/primaryIPsResponse.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { PrimaryIP } from './primaryIP'; + +export class PrimaryIPsResponse { + 'meta'?: ActionsResponseMeta; + 'primaryIps': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + }, + { + "name": "primaryIps", + "baseName": "primary_ips", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return PrimaryIPsResponse.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/rebuildServerRequest.ts b/ts_openapi/model/rebuildServerRequest.ts new file mode 100644 index 0000000..970f0ab --- /dev/null +++ b/ts_openapi/model/rebuildServerRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class RebuildServerRequest { + /** + * ID or name of Image to rebuilt from. + */ + 'image': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "image", + "baseName": "image", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return RebuildServerRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/removeFromResourcesRequest.ts b/ts_openapi/model/removeFromResourcesRequest.ts new file mode 100644 index 0000000..9db01ab --- /dev/null +++ b/ts_openapi/model/removeFromResourcesRequest.ts @@ -0,0 +1,35 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FirewallRemoveFromResources } from './firewallRemoveFromResources'; + +export class RemoveFromResourcesRequest { + /** + * Resources the Firewall should be removed from + */ + 'removeFrom': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "removeFrom", + "baseName": "remove_from", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return RemoveFromResourcesRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/removeTargetRequest.ts b/ts_openapi/model/removeTargetRequest.ts new file mode 100644 index 0000000..336b5f0 --- /dev/null +++ b/ts_openapi/model/removeTargetRequest.ts @@ -0,0 +1,62 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { AddTargetRequestLabelSelector } from './addTargetRequestLabelSelector'; +import { AddTargetRequestServer } from './addTargetRequestServer'; +import { LoadBalancerTargetIP } from './loadBalancerTargetIP'; + +export class RemoveTargetRequest { + 'ip'?: LoadBalancerTargetIP; + 'labelSelector'?: AddTargetRequestLabelSelector; + 'server'?: AddTargetRequestServer; + /** + * Type of the resource + */ + 'type': RemoveTargetRequest.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "ip", + "baseName": "ip", + "type": "LoadBalancerTargetIP" + }, + { + "name": "labelSelector", + "baseName": "label_selector", + "type": "AddTargetRequestLabelSelector" + }, + { + "name": "server", + "baseName": "server", + "type": "AddTargetRequestServer" + }, + { + "name": "type", + "baseName": "type", + "type": "RemoveTargetRequest.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return RemoveTargetRequest.attributeTypeMap; + } +} + +export namespace RemoveTargetRequest { + export enum TypeEnum { + Server = 'server', + LabelSelector = 'label_selector', + Ip = 'ip' + } +} diff --git a/ts_openapi/model/rule.ts b/ts_openapi/model/rule.ts new file mode 100644 index 0000000..7164e60 --- /dev/null +++ b/ts_openapi/model/rule.ts @@ -0,0 +1,92 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class Rule { + /** + * Description of the Rule + */ + 'description'?: string | null; + /** + * List of permitted IPv4/IPv6 addresses in CIDR notation. Use `0.0.0.0/0` to allow all IPv4 addresses and `::/0` to allow all IPv6 addresses. You can specify 100 CIDRs at most. + */ + 'destinationIps'?: Array; + /** + * Select traffic direction on which rule should be applied. Use `source_ips` for direction `in` and `destination_ips` for direction `out`. + */ + 'direction': Rule.DirectionEnum; + /** + * Port or port range to which traffic will be allowed, only applicable for protocols TCP and UDP. A port range can be specified by separating two ports with a dash, e.g `1024-5000`. + */ + 'port'?: string; + /** + * Type of traffic to allow + */ + 'protocol': Rule.ProtocolEnum; + /** + * List of permitted IPv4/IPv6 addresses in CIDR notation. Use `0.0.0.0/0` to allow all IPv4 addresses and `::/0` to allow all IPv6 addresses. You can specify 100 CIDRs at most. + */ + 'sourceIps'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "destinationIps", + "baseName": "destination_ips", + "type": "Array" + }, + { + "name": "direction", + "baseName": "direction", + "type": "Rule.DirectionEnum" + }, + { + "name": "port", + "baseName": "port", + "type": "string" + }, + { + "name": "protocol", + "baseName": "protocol", + "type": "Rule.ProtocolEnum" + }, + { + "name": "sourceIps", + "baseName": "source_ips", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return Rule.attributeTypeMap; + } +} + +export namespace Rule { + export enum DirectionEnum { + In = 'in', + Out = 'out' + } + export enum ProtocolEnum { + Tcp = 'tcp', + Udp = 'udp', + Icmp = 'icmp', + Esp = 'esp', + Gre = 'gre' + } +} diff --git a/ts_openapi/model/serverPublicNetFirewall.ts b/ts_openapi/model/serverPublicNetFirewall.ts new file mode 100644 index 0000000..f0625b8 --- /dev/null +++ b/ts_openapi/model/serverPublicNetFirewall.ts @@ -0,0 +1,49 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ServerPublicNetFirewall { + /** + * ID of the Resource + */ + 'id'?: number; + /** + * Status of the Firewall on the Server + */ + 'status'?: ServerPublicNetFirewall.StatusEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "status", + "baseName": "status", + "type": "ServerPublicNetFirewall.StatusEnum" + } ]; + + static getAttributeTypeMap() { + return ServerPublicNetFirewall.attributeTypeMap; + } +} + +export namespace ServerPublicNetFirewall { + export enum StatusEnum { + Applied = 'applied', + Pending = 'pending' + } +} diff --git a/ts_openapi/model/serverTypesGet200Response.ts b/ts_openapi/model/serverTypesGet200Response.ts new file mode 100644 index 0000000..b89df29 --- /dev/null +++ b/ts_openapi/model/serverTypesGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ServerTypesGet200ResponseServerTypesInner } from './serverTypesGet200ResponseServerTypesInner'; + +export class ServerTypesGet200Response { + 'serverTypes': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "serverTypes", + "baseName": "server_types", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return ServerTypesGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serverTypesGet200ResponseServerTypesInner.ts b/ts_openapi/model/serverTypesGet200ResponseServerTypesInner.ts new file mode 100644 index 0000000..ff8e074 --- /dev/null +++ b/ts_openapi/model/serverTypesGet200ResponseServerTypesInner.ts @@ -0,0 +1,155 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { DeprecationInfo } from './deprecationInfo'; +import { PricingGet200ResponsePricingServerTypesInnerPricesInner } from './pricingGet200ResponsePricingServerTypesInnerPricesInner'; + +export class ServerTypesGet200ResponseServerTypesInner { + /** + * Type of cpu architecture + */ + 'architecture': ServerTypesGet200ResponseServerTypesInner.ArchitectureEnum; + /** + * Number of cpu cores a Server of this type will have + */ + 'cores': number; + /** + * Type of cpu + */ + 'cpuType': ServerTypesGet200ResponseServerTypesInner.CpuTypeEnum; + /** + * This field is deprecated. Use the deprecation object instead + */ + 'deprecated': boolean; + 'deprecation'?: DeprecationInfo | null; + /** + * Description of the Server type + */ + 'description': string; + /** + * Disk size a Server of this type will have in GB + */ + 'disk': number; + /** + * ID of the Server type + */ + 'id': number; + /** + * Free traffic per month in bytes + */ + 'includedTraffic': number; + /** + * Memory a Server of this type will have in GB + */ + 'memory': number; + /** + * Unique identifier of the Server type + */ + 'name': string; + /** + * Prices in different Locations + */ + 'prices': Array; + /** + * Type of Server boot drive. Local has higher speed. Network has better availability. + */ + 'storageType': ServerTypesGet200ResponseServerTypesInner.StorageTypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "architecture", + "baseName": "architecture", + "type": "ServerTypesGet200ResponseServerTypesInner.ArchitectureEnum" + }, + { + "name": "cores", + "baseName": "cores", + "type": "number" + }, + { + "name": "cpuType", + "baseName": "cpu_type", + "type": "ServerTypesGet200ResponseServerTypesInner.CpuTypeEnum" + }, + { + "name": "deprecated", + "baseName": "deprecated", + "type": "boolean" + }, + { + "name": "deprecation", + "baseName": "deprecation", + "type": "DeprecationInfo" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "disk", + "baseName": "disk", + "type": "number" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "includedTraffic", + "baseName": "included_traffic", + "type": "number" + }, + { + "name": "memory", + "baseName": "memory", + "type": "number" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "prices", + "baseName": "prices", + "type": "Array" + }, + { + "name": "storageType", + "baseName": "storage_type", + "type": "ServerTypesGet200ResponseServerTypesInner.StorageTypeEnum" + } ]; + + static getAttributeTypeMap() { + return ServerTypesGet200ResponseServerTypesInner.attributeTypeMap; + } +} + +export namespace ServerTypesGet200ResponseServerTypesInner { + export enum ArchitectureEnum { + X86 = 'x86', + Arm = 'arm' + } + export enum CpuTypeEnum { + Shared = 'shared', + Dedicated = 'dedicated' + } + export enum StorageTypeEnum { + Local = 'local', + Network = 'network' + } +} diff --git a/ts_openapi/model/serverTypesIdGet200Response.ts b/ts_openapi/model/serverTypesIdGet200Response.ts new file mode 100644 index 0000000..41a8dbe --- /dev/null +++ b/ts_openapi/model/serverTypesIdGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ServerTypesGet200ResponseServerTypesInner } from './serverTypesGet200ResponseServerTypesInner'; + +export class ServerTypesIdGet200Response { + 'serverType': ServerTypesGet200ResponseServerTypesInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "serverType", + "baseName": "server_type", + "type": "ServerTypesGet200ResponseServerTypesInner" + } ]; + + static getAttributeTypeMap() { + return ServerTypesIdGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversGet200Response.ts b/ts_openapi/model/serversGet200Response.ts new file mode 100644 index 0000000..f9f7109 --- /dev/null +++ b/ts_openapi/model/serversGet200Response.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { ServersGet200ResponseServersInner } from './serversGet200ResponseServersInner'; + +export class ServersGet200Response { + 'meta'?: ActionsResponseMeta; + 'servers': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + }, + { + "name": "servers", + "baseName": "servers", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return ServersGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversGet200ResponseServersInner.ts b/ts_openapi/model/serversGet200ResponseServersInner.ts new file mode 100644 index 0000000..d0a69a5 --- /dev/null +++ b/ts_openapi/model/serversGet200ResponseServersInner.ts @@ -0,0 +1,223 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PlacementGroupNullable } from './placementGroupNullable'; +import { ServersGet200ResponseServersInnerDatacenter } from './serversGet200ResponseServersInnerDatacenter'; +import { ServersGet200ResponseServersInnerImage } from './serversGet200ResponseServersInnerImage'; +import { ServersGet200ResponseServersInnerIso } from './serversGet200ResponseServersInnerIso'; +import { ServersGet200ResponseServersInnerPrivateNetInner } from './serversGet200ResponseServersInnerPrivateNetInner'; +import { ServersGet200ResponseServersInnerProtection } from './serversGet200ResponseServersInnerProtection'; +import { ServersGet200ResponseServersInnerPublicNet } from './serversGet200ResponseServersInnerPublicNet'; +import { ServersGet200ResponseServersInnerServerType } from './serversGet200ResponseServersInnerServerType'; + +export class ServersGet200ResponseServersInner { + /** + * Time window (UTC) in which the backup will run, or null if the backups are not enabled + */ + 'backupWindow': string | null; + /** + * Point in time when the Resource was created (in ISO-8601 format) + */ + 'created': string; + 'datacenter': ServersGet200ResponseServersInnerDatacenter; + /** + * ID of the Resource + */ + 'id': number; + 'image': ServersGet200ResponseServersInnerImage | null; + /** + * Free Traffic for the current billing period in bytes + */ + 'includedTraffic': number | null; + /** + * Inbound Traffic for the current billing period in bytes + */ + 'ingoingTraffic': number | null; + 'iso': ServersGet200ResponseServersInnerIso | null; + /** + * User-defined labels (key-value pairs) + */ + 'labels': { [key: string]: string; }; + /** + * Load Balancer IDs assigned to the server. + */ + 'loadBalancers'?: Array; + /** + * True if Server has been locked and is not available to user + */ + 'locked': boolean; + /** + * Name of the Server (must be unique per Project and a valid hostname as per RFC 1123) + */ + 'name': string; + /** + * Outbound Traffic for the current billing period in bytes + */ + 'outgoingTraffic': number | null; + 'placementGroup'?: PlacementGroupNullable | null; + /** + * Size of the primary Disk + */ + 'primaryDiskSize': number; + /** + * Private networks information + */ + 'privateNet': Array; + 'protection': ServersGet200ResponseServersInnerProtection; + 'publicNet': ServersGet200ResponseServersInnerPublicNet; + /** + * True if rescue mode is enabled. Server will then boot into rescue system on next reboot + */ + 'rescueEnabled': boolean; + 'serverType': ServersGet200ResponseServersInnerServerType; + /** + * Status of the Server + */ + 'status': ServersGet200ResponseServersInner.StatusEnum; + /** + * IDs of Volumes assigned to this Server + */ + 'volumes'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "backupWindow", + "baseName": "backup_window", + "type": "string" + }, + { + "name": "created", + "baseName": "created", + "type": "string" + }, + { + "name": "datacenter", + "baseName": "datacenter", + "type": "ServersGet200ResponseServersInnerDatacenter" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "image", + "baseName": "image", + "type": "ServersGet200ResponseServersInnerImage" + }, + { + "name": "includedTraffic", + "baseName": "included_traffic", + "type": "number" + }, + { + "name": "ingoingTraffic", + "baseName": "ingoing_traffic", + "type": "number" + }, + { + "name": "iso", + "baseName": "iso", + "type": "ServersGet200ResponseServersInnerIso" + }, + { + "name": "labels", + "baseName": "labels", + "type": "{ [key: string]: string; }" + }, + { + "name": "loadBalancers", + "baseName": "load_balancers", + "type": "Array" + }, + { + "name": "locked", + "baseName": "locked", + "type": "boolean" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "outgoingTraffic", + "baseName": "outgoing_traffic", + "type": "number" + }, + { + "name": "placementGroup", + "baseName": "placement_group", + "type": "PlacementGroupNullable" + }, + { + "name": "primaryDiskSize", + "baseName": "primary_disk_size", + "type": "number" + }, + { + "name": "privateNet", + "baseName": "private_net", + "type": "Array" + }, + { + "name": "protection", + "baseName": "protection", + "type": "ServersGet200ResponseServersInnerProtection" + }, + { + "name": "publicNet", + "baseName": "public_net", + "type": "ServersGet200ResponseServersInnerPublicNet" + }, + { + "name": "rescueEnabled", + "baseName": "rescue_enabled", + "type": "boolean" + }, + { + "name": "serverType", + "baseName": "server_type", + "type": "ServersGet200ResponseServersInnerServerType" + }, + { + "name": "status", + "baseName": "status", + "type": "ServersGet200ResponseServersInner.StatusEnum" + }, + { + "name": "volumes", + "baseName": "volumes", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return ServersGet200ResponseServersInner.attributeTypeMap; + } +} + +export namespace ServersGet200ResponseServersInner { + export enum StatusEnum { + Running = 'running', + Initializing = 'initializing', + Starting = 'starting', + Stopping = 'stopping', + Off = 'off', + Deleting = 'deleting', + Migrating = 'migrating', + Rebuilding = 'rebuilding', + Unknown = 'unknown' + } +} diff --git a/ts_openapi/model/serversGet200ResponseServersInnerDatacenter.ts b/ts_openapi/model/serversGet200ResponseServersInnerDatacenter.ts new file mode 100644 index 0000000..0d919b8 --- /dev/null +++ b/ts_openapi/model/serversGet200ResponseServersInnerDatacenter.ts @@ -0,0 +1,69 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { DatacentersGet200ResponseDatacentersInnerLocation } from './datacentersGet200ResponseDatacentersInnerLocation'; +import { DatacentersGet200ResponseDatacentersInnerServerTypes } from './datacentersGet200ResponseDatacentersInnerServerTypes'; + +/** +* Datacenter this Resource is located at +*/ +export class ServersGet200ResponseServersInnerDatacenter { + /** + * Description of the Datacenter + */ + 'description': string; + /** + * ID of the Resource + */ + 'id': number; + 'location': DatacentersGet200ResponseDatacentersInnerLocation; + /** + * Unique identifier of the Datacenter + */ + 'name': string; + 'serverTypes': DatacentersGet200ResponseDatacentersInnerServerTypes; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "location", + "baseName": "location", + "type": "DatacentersGet200ResponseDatacentersInnerLocation" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "serverTypes", + "baseName": "server_types", + "type": "DatacentersGet200ResponseDatacentersInnerServerTypes" + } ]; + + static getAttributeTypeMap() { + return ServersGet200ResponseServersInnerDatacenter.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversGet200ResponseServersInnerImage.ts b/ts_openapi/model/serversGet200ResponseServersInnerImage.ts new file mode 100644 index 0000000..0252642 --- /dev/null +++ b/ts_openapi/model/serversGet200ResponseServersInnerImage.ts @@ -0,0 +1,213 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FloatingIpsGet200ResponseFloatingIpsInnerProtection } from './floatingIpsGet200ResponseFloatingIpsInnerProtection'; +import { ImagesGet200ResponseImagesInnerCreatedFrom } from './imagesGet200ResponseImagesInnerCreatedFrom'; + +/** +* Image the server is based on. +*/ +export class ServersGet200ResponseServersInnerImage { + /** + * Type of cpu architecture this image is compatible with. + */ + 'architecture': ServersGet200ResponseServersInnerImage.ArchitectureEnum; + /** + * ID of Server the Image is bound to. Only set for Images of type `backup`. + */ + 'boundTo': number | null; + /** + * Point in time when the Resource was created (in ISO-8601 format) + */ + 'created': string; + 'createdFrom': ImagesGet200ResponseImagesInnerCreatedFrom | null; + /** + * Point in time where the Image was deleted (in ISO-8601 format) + */ + 'deleted': string | null; + /** + * Point in time when the Image is considered to be deprecated (in ISO-8601 format) + */ + 'deprecated': string | null; + /** + * Description of the Image + */ + 'description': string; + /** + * Size of the disk contained in the Image in GB + */ + 'diskSize': number; + /** + * ID of the Resource + */ + 'id': number; + /** + * Size of the Image file in our storage in GB. For snapshot Images this is the value relevant for calculating costs for the Image. + */ + 'imageSize': number | null; + /** + * User-defined labels (key-value pairs) + */ + 'labels': { [key: string]: string; }; + /** + * Unique identifier of the Image. This value is only set for system Images. + */ + 'name': string | null; + /** + * Flavor of operating system contained in the Image + */ + 'osFlavor': ServersGet200ResponseServersInnerImage.OsFlavorEnum; + /** + * Operating system version + */ + 'osVersion': string | null; + 'protection': FloatingIpsGet200ResponseFloatingIpsInnerProtection; + /** + * Indicates that rapid deploy of the Image is available + */ + 'rapidDeploy'?: boolean; + /** + * Whether the Image can be used or if it\'s still being created or unavailable + */ + 'status': ServersGet200ResponseServersInnerImage.StatusEnum; + /** + * Type of the Image + */ + 'type': ServersGet200ResponseServersInnerImage.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "architecture", + "baseName": "architecture", + "type": "ServersGet200ResponseServersInnerImage.ArchitectureEnum" + }, + { + "name": "boundTo", + "baseName": "bound_to", + "type": "number" + }, + { + "name": "created", + "baseName": "created", + "type": "string" + }, + { + "name": "createdFrom", + "baseName": "created_from", + "type": "ImagesGet200ResponseImagesInnerCreatedFrom" + }, + { + "name": "deleted", + "baseName": "deleted", + "type": "string" + }, + { + "name": "deprecated", + "baseName": "deprecated", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "diskSize", + "baseName": "disk_size", + "type": "number" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "imageSize", + "baseName": "image_size", + "type": "number" + }, + { + "name": "labels", + "baseName": "labels", + "type": "{ [key: string]: string; }" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "osFlavor", + "baseName": "os_flavor", + "type": "ServersGet200ResponseServersInnerImage.OsFlavorEnum" + }, + { + "name": "osVersion", + "baseName": "os_version", + "type": "string" + }, + { + "name": "protection", + "baseName": "protection", + "type": "FloatingIpsGet200ResponseFloatingIpsInnerProtection" + }, + { + "name": "rapidDeploy", + "baseName": "rapid_deploy", + "type": "boolean" + }, + { + "name": "status", + "baseName": "status", + "type": "ServersGet200ResponseServersInnerImage.StatusEnum" + }, + { + "name": "type", + "baseName": "type", + "type": "ServersGet200ResponseServersInnerImage.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return ServersGet200ResponseServersInnerImage.attributeTypeMap; + } +} + +export namespace ServersGet200ResponseServersInnerImage { + export enum ArchitectureEnum { + X86 = 'x86', + Arm = 'arm' + } + export enum OsFlavorEnum { + Ubuntu = 'ubuntu', + Centos = 'centos', + Debian = 'debian', + Fedora = 'fedora', + Rocky = 'rocky', + Alma = 'alma', + Unknown = 'unknown' + } + export enum StatusEnum { + Available = 'available', + Creating = 'creating', + Unavailable = 'unavailable' + } + export enum TypeEnum { + System = 'system', + App = 'app', + Snapshot = 'snapshot', + Backup = 'backup', + Temporary = 'temporary' + } +} diff --git a/ts_openapi/model/serversGet200ResponseServersInnerIso.ts b/ts_openapi/model/serversGet200ResponseServersInnerIso.ts new file mode 100644 index 0000000..2ef1851 --- /dev/null +++ b/ts_openapi/model/serversGet200ResponseServersInnerIso.ts @@ -0,0 +1,90 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { DeprecationInfo } from './deprecationInfo'; + +/** +* ISO Image that is attached to this Server. Null if no ISO is attached. +*/ +export class ServersGet200ResponseServersInnerIso { + /** + * Type of cpu architecture this iso is compatible with. Null indicates no restriction on the architecture (wildcard). + */ + 'architecture': ServersGet200ResponseServersInnerIso.ArchitectureEnum; + 'deprecation': DeprecationInfo | null; + /** + * Description of the ISO + */ + 'description': string; + /** + * ID of the Resource + */ + 'id': number; + /** + * Unique identifier of the ISO. Only set for public ISOs + */ + 'name': string | null; + /** + * Type of the ISO + */ + 'type': ServersGet200ResponseServersInnerIso.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "architecture", + "baseName": "architecture", + "type": "ServersGet200ResponseServersInnerIso.ArchitectureEnum" + }, + { + "name": "deprecation", + "baseName": "deprecation", + "type": "DeprecationInfo" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "type", + "baseName": "type", + "type": "ServersGet200ResponseServersInnerIso.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return ServersGet200ResponseServersInnerIso.attributeTypeMap; + } +} + +export namespace ServersGet200ResponseServersInnerIso { + export enum ArchitectureEnum { + X86 = 'x86', + Arm = 'arm' + } + export enum TypeEnum { + Public = 'public', + Private = 'private' + } +} diff --git a/ts_openapi/model/serversGet200ResponseServersInnerPrivateNetInner.ts b/ts_openapi/model/serversGet200ResponseServersInnerPrivateNetInner.ts new file mode 100644 index 0000000..1436690 --- /dev/null +++ b/ts_openapi/model/serversGet200ResponseServersInnerPrivateNetInner.ts @@ -0,0 +1,61 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ServersGet200ResponseServersInnerPrivateNetInner { + /** + * Additional IP addresses of the server on the network. + */ + 'aliasIps'?: Array; + /** + * The server IP address on the network. + */ + 'ip'?: string; + /** + * The server MAC address on the network. + */ + 'macAddress'?: string; + /** + * The Network ID the server is attached to. + */ + 'network'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "aliasIps", + "baseName": "alias_ips", + "type": "Array" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + }, + { + "name": "macAddress", + "baseName": "mac_address", + "type": "string" + }, + { + "name": "network", + "baseName": "network", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return ServersGet200ResponseServersInnerPrivateNetInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversGet200ResponseServersInnerProtection.ts b/ts_openapi/model/serversGet200ResponseServersInnerProtection.ts new file mode 100644 index 0000000..a786a07 --- /dev/null +++ b/ts_openapi/model/serversGet200ResponseServersInnerProtection.ts @@ -0,0 +1,46 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Protection configuration for the Server +*/ +export class ServersGet200ResponseServersInnerProtection { + /** + * If true, prevents the Server from being deleted + */ + '_delete': boolean; + /** + * If true, prevents the Server from being rebuilt + */ + 'rebuild': boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "_delete", + "baseName": "delete", + "type": "boolean" + }, + { + "name": "rebuild", + "baseName": "rebuild", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return ServersGet200ResponseServersInnerProtection.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversGet200ResponseServersInnerPublicNet.ts b/ts_openapi/model/serversGet200ResponseServersInnerPublicNet.ts new file mode 100644 index 0000000..2281364 --- /dev/null +++ b/ts_openapi/model/serversGet200ResponseServersInnerPublicNet.ts @@ -0,0 +1,61 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ServerPublicNetFirewall } from './serverPublicNetFirewall'; +import { ServersGet200ResponseServersInnerPublicNetIpv4 } from './serversGet200ResponseServersInnerPublicNetIpv4'; +import { ServersGet200ResponseServersInnerPublicNetIpv6 } from './serversGet200ResponseServersInnerPublicNetIpv6'; + +/** +* Public network information. The Server\'s IPv4 address can be found in `public_net->ipv4->ip` +*/ +export class ServersGet200ResponseServersInnerPublicNet { + /** + * Firewalls applied to the public network interface of this Server + */ + 'firewalls'?: Array; + /** + * IDs of Floating IPs assigned to this Server + */ + 'floatingIps': Array; + 'ipv4': ServersGet200ResponseServersInnerPublicNetIpv4 | null; + 'ipv6': ServersGet200ResponseServersInnerPublicNetIpv6 | null; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "firewalls", + "baseName": "firewalls", + "type": "Array" + }, + { + "name": "floatingIps", + "baseName": "floating_ips", + "type": "Array" + }, + { + "name": "ipv4", + "baseName": "ipv4", + "type": "ServersGet200ResponseServersInnerPublicNetIpv4" + }, + { + "name": "ipv6", + "baseName": "ipv6", + "type": "ServersGet200ResponseServersInnerPublicNetIpv6" + } ]; + + static getAttributeTypeMap() { + return ServersGet200ResponseServersInnerPublicNet.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversGet200ResponseServersInnerPublicNetIpv4.ts b/ts_openapi/model/serversGet200ResponseServersInnerPublicNetIpv4.ts new file mode 100644 index 0000000..0d1299c --- /dev/null +++ b/ts_openapi/model/serversGet200ResponseServersInnerPublicNetIpv4.ts @@ -0,0 +1,64 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* IP address (v4) and its reverse DNS entry of this Server +*/ +export class ServersGet200ResponseServersInnerPublicNetIpv4 { + /** + * If the IP is blocked by our anti abuse dept + */ + 'blocked': boolean; + /** + * Reverse DNS PTR entry for the IPv4 addresses of this Server + */ + 'dnsPtr': string; + /** + * ID of the Resource + */ + 'id'?: number; + /** + * IP address (v4) of this Server + */ + 'ip': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "blocked", + "baseName": "blocked", + "type": "boolean" + }, + { + "name": "dnsPtr", + "baseName": "dns_ptr", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ServersGet200ResponseServersInnerPublicNetIpv4.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversGet200ResponseServersInnerPublicNetIpv6.ts b/ts_openapi/model/serversGet200ResponseServersInnerPublicNetIpv6.ts new file mode 100644 index 0000000..a43a07b --- /dev/null +++ b/ts_openapi/model/serversGet200ResponseServersInnerPublicNetIpv6.ts @@ -0,0 +1,65 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ServersGet200ResponseServersInnerPublicNetIpv6DnsPtrInner } from './serversGet200ResponseServersInnerPublicNetIpv6DnsPtrInner'; + +/** +* IPv6 network assigned to this Server and its reverse DNS entry +*/ +export class ServersGet200ResponseServersInnerPublicNetIpv6 { + /** + * If the IP is blocked by our anti abuse dept + */ + 'blocked': boolean; + /** + * Reverse DNS PTR entries for the IPv6 addresses of this Server + */ + 'dnsPtr': Array | null; + /** + * ID of the Resource + */ + 'id'?: number; + /** + * IP address (v6) of this Server + */ + 'ip': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "blocked", + "baseName": "blocked", + "type": "boolean" + }, + { + "name": "dnsPtr", + "baseName": "dns_ptr", + "type": "Array" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ServersGet200ResponseServersInnerPublicNetIpv6.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversGet200ResponseServersInnerPublicNetIpv6DnsPtrInner.ts b/ts_openapi/model/serversGet200ResponseServersInnerPublicNetIpv6DnsPtrInner.ts new file mode 100644 index 0000000..d8b80d2 --- /dev/null +++ b/ts_openapi/model/serversGet200ResponseServersInnerPublicNetIpv6DnsPtrInner.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ServersGet200ResponseServersInnerPublicNetIpv6DnsPtrInner { + /** + * DNS pointer for the specific IP address + */ + 'dnsPtr': string; + /** + * Single IPv6 address of this Server for which the reverse DNS entry has been set up + */ + 'ip': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "dnsPtr", + "baseName": "dns_ptr", + "type": "string" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ServersGet200ResponseServersInnerPublicNetIpv6DnsPtrInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversGet200ResponseServersInnerServerType.ts b/ts_openapi/model/serversGet200ResponseServersInnerServerType.ts new file mode 100644 index 0000000..15e3aa9 --- /dev/null +++ b/ts_openapi/model/serversGet200ResponseServersInnerServerType.ts @@ -0,0 +1,129 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { PricingGet200ResponsePricingServerTypesInnerPricesInner } from './pricingGet200ResponsePricingServerTypesInnerPricesInner'; + +/** +* Type of Server - determines how much ram, disk and cpu a Server has +*/ +export class ServersGet200ResponseServersInnerServerType { + /** + * Number of cpu cores a Server of this type will have + */ + 'cores': number; + /** + * Type of cpu + */ + 'cpuType': ServersGet200ResponseServersInnerServerType.CpuTypeEnum; + /** + * True if Server type is deprecated + */ + 'deprecated': boolean; + /** + * Description of the Server type + */ + 'description': string; + /** + * Disk size a Server of this type will have in GB + */ + 'disk': number; + /** + * ID of the Server type + */ + 'id': number; + /** + * Memory a Server of this type will have in GB + */ + 'memory': number; + /** + * Unique identifier of the Server type + */ + 'name': string; + /** + * Prices in different Locations + */ + 'prices': Array; + /** + * Type of Server boot drive. Local has higher speed. Network has better availability. + */ + 'storageType': ServersGet200ResponseServersInnerServerType.StorageTypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "cores", + "baseName": "cores", + "type": "number" + }, + { + "name": "cpuType", + "baseName": "cpu_type", + "type": "ServersGet200ResponseServersInnerServerType.CpuTypeEnum" + }, + { + "name": "deprecated", + "baseName": "deprecated", + "type": "boolean" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "disk", + "baseName": "disk", + "type": "number" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "memory", + "baseName": "memory", + "type": "number" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "prices", + "baseName": "prices", + "type": "Array" + }, + { + "name": "storageType", + "baseName": "storage_type", + "type": "ServersGet200ResponseServersInnerServerType.StorageTypeEnum" + } ]; + + static getAttributeTypeMap() { + return ServersGet200ResponseServersInnerServerType.attributeTypeMap; + } +} + +export namespace ServersGet200ResponseServersInnerServerType { + export enum CpuTypeEnum { + Shared = 'shared', + Dedicated = 'dedicated' + } + export enum StorageTypeEnum { + Local = 'local', + Network = 'network' + } +} diff --git a/ts_openapi/model/serversIdActionsAttachIsoPostRequest.ts b/ts_openapi/model/serversIdActionsAttachIsoPostRequest.ts new file mode 100644 index 0000000..eeb726c --- /dev/null +++ b/ts_openapi/model/serversIdActionsAttachIsoPostRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ServersIdActionsAttachIsoPostRequest { + /** + * ID or name of ISO to attach to the Server as listed in GET `/isos` + */ + 'iso': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "iso", + "baseName": "iso", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ServersIdActionsAttachIsoPostRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversIdActionsChangeAliasIpsPostRequest.ts b/ts_openapi/model/serversIdActionsChangeAliasIpsPostRequest.ts new file mode 100644 index 0000000..dbda01c --- /dev/null +++ b/ts_openapi/model/serversIdActionsChangeAliasIpsPostRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ServersIdActionsChangeAliasIpsPostRequest { + /** + * New alias IPs to set for this Server + */ + 'aliasIps': Array; + /** + * ID of an existing Network already attached to the Server + */ + 'network': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "aliasIps", + "baseName": "alias_ips", + "type": "Array" + }, + { + "name": "network", + "baseName": "network", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return ServersIdActionsChangeAliasIpsPostRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversIdActionsChangeDnsPtrPostRequest.ts b/ts_openapi/model/serversIdActionsChangeDnsPtrPostRequest.ts new file mode 100644 index 0000000..09e1102 --- /dev/null +++ b/ts_openapi/model/serversIdActionsChangeDnsPtrPostRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ServersIdActionsChangeDnsPtrPostRequest { + /** + * Hostname to set as a reverse DNS PTR entry, reset to original value if `null` + */ + 'dnsPtr': string | null; + /** + * Primary IP address for which the reverse DNS entry should be set + */ + 'ip': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "dnsPtr", + "baseName": "dns_ptr", + "type": "string" + }, + { + "name": "ip", + "baseName": "ip", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ServersIdActionsChangeDnsPtrPostRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversIdActionsChangeProtectionPostRequest.ts b/ts_openapi/model/serversIdActionsChangeProtectionPostRequest.ts new file mode 100644 index 0000000..9bcc58a --- /dev/null +++ b/ts_openapi/model/serversIdActionsChangeProtectionPostRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ServersIdActionsChangeProtectionPostRequest { + /** + * If true, prevents the Server from being deleted (currently delete and rebuild attribute needs to have the same value) + */ + '_delete'?: boolean; + /** + * If true, prevents the Server from being rebuilt (currently delete and rebuild attribute needs to have the same value) + */ + 'rebuild'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "_delete", + "baseName": "delete", + "type": "boolean" + }, + { + "name": "rebuild", + "baseName": "rebuild", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return ServersIdActionsChangeProtectionPostRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversIdActionsChangeTypePostRequest.ts b/ts_openapi/model/serversIdActionsChangeTypePostRequest.ts new file mode 100644 index 0000000..753d636 --- /dev/null +++ b/ts_openapi/model/serversIdActionsChangeTypePostRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ServersIdActionsChangeTypePostRequest { + /** + * ID or name of Server type the Server should migrate to + */ + 'serverType': string; + /** + * If false, do not upgrade the disk (this allows downgrading the Server type later) + */ + 'upgradeDisk': boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "serverType", + "baseName": "server_type", + "type": "string" + }, + { + "name": "upgradeDisk", + "baseName": "upgrade_disk", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return ServersIdActionsChangeTypePostRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversIdActionsCreateImagePost201Response.ts b/ts_openapi/model/serversIdActionsCreateImagePost201Response.ts new file mode 100644 index 0000000..02423ec --- /dev/null +++ b/ts_openapi/model/serversIdActionsCreateImagePost201Response.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; +import { ImagesGet200ResponseImagesInner } from './imagesGet200ResponseImagesInner'; + +export class ServersIdActionsCreateImagePost201Response { + 'action'?: Action; + 'image'?: ImagesGet200ResponseImagesInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "action", + "baseName": "action", + "type": "Action" + }, + { + "name": "image", + "baseName": "image", + "type": "ImagesGet200ResponseImagesInner" + } ]; + + static getAttributeTypeMap() { + return ServersIdActionsCreateImagePost201Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversIdActionsEnableRescuePost201Response.ts b/ts_openapi/model/serversIdActionsEnableRescuePost201Response.ts new file mode 100644 index 0000000..8582a9a --- /dev/null +++ b/ts_openapi/model/serversIdActionsEnableRescuePost201Response.ts @@ -0,0 +1,41 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; + +export class ServersIdActionsEnableRescuePost201Response { + 'action'?: Action; + /** + * Password that will be set for this Server once the Action succeeds + */ + 'rootPassword'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "action", + "baseName": "action", + "type": "Action" + }, + { + "name": "rootPassword", + "baseName": "root_password", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ServersIdActionsEnableRescuePost201Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversIdActionsEnableRescuePostRequest.ts b/ts_openapi/model/serversIdActionsEnableRescuePostRequest.ts new file mode 100644 index 0000000..64dc316 --- /dev/null +++ b/ts_openapi/model/serversIdActionsEnableRescuePostRequest.ts @@ -0,0 +1,48 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class ServersIdActionsEnableRescuePostRequest { + /** + * Array of SSH key IDs which should be injected into the rescue system. + */ + 'sshKeys'?: Array; + /** + * Type of rescue system to boot. + */ + 'type'?: ServersIdActionsEnableRescuePostRequest.TypeEnum = ServersIdActionsEnableRescuePostRequest.TypeEnum.Linux64; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "sshKeys", + "baseName": "ssh_keys", + "type": "Array" + }, + { + "name": "type", + "baseName": "type", + "type": "ServersIdActionsEnableRescuePostRequest.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return ServersIdActionsEnableRescuePostRequest.attributeTypeMap; + } +} + +export namespace ServersIdActionsEnableRescuePostRequest { + export enum TypeEnum { + Linux64 = 'linux64' + } +} diff --git a/ts_openapi/model/serversIdActionsRebuildPost201Response.ts b/ts_openapi/model/serversIdActionsRebuildPost201Response.ts new file mode 100644 index 0000000..02d8c04 --- /dev/null +++ b/ts_openapi/model/serversIdActionsRebuildPost201Response.ts @@ -0,0 +1,41 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; + +export class ServersIdActionsRebuildPost201Response { + 'action'?: Action; + /** + * New root password when not using SSH keys + */ + 'rootPassword'?: string | null; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "action", + "baseName": "action", + "type": "Action" + }, + { + "name": "rootPassword", + "baseName": "root_password", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ServersIdActionsRebuildPost201Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversIdActionsRequestConsolePost201Response.ts b/ts_openapi/model/serversIdActionsRequestConsolePost201Response.ts new file mode 100644 index 0000000..b1e6f85 --- /dev/null +++ b/ts_openapi/model/serversIdActionsRequestConsolePost201Response.ts @@ -0,0 +1,50 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; + +export class ServersIdActionsRequestConsolePost201Response { + 'action': Action; + /** + * VNC password to use for this connection (this password only works in combination with a wss_url with valid token) + */ + 'password': string; + /** + * URL of websocket proxy to use; this includes a token which is valid for a limited time only + */ + 'wssUrl': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "action", + "baseName": "action", + "type": "Action" + }, + { + "name": "password", + "baseName": "password", + "type": "string" + }, + { + "name": "wssUrl", + "baseName": "wss_url", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ServersIdActionsRequestConsolePost201Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversIdDelete200Response.ts b/ts_openapi/model/serversIdDelete200Response.ts new file mode 100644 index 0000000..934550c --- /dev/null +++ b/ts_openapi/model/serversIdDelete200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; + +export class ServersIdDelete200Response { + 'action'?: Action; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "action", + "baseName": "action", + "type": "Action" + } ]; + + static getAttributeTypeMap() { + return ServersIdDelete200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/serversIdGet200Response.ts b/ts_openapi/model/serversIdGet200Response.ts new file mode 100644 index 0000000..3c15da2 --- /dev/null +++ b/ts_openapi/model/serversIdGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ServersGet200ResponseServersInner } from './serversGet200ResponseServersInner'; + +export class ServersIdGet200Response { + 'server'?: ServersGet200ResponseServersInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "server", + "baseName": "server", + "type": "ServersGet200ResponseServersInner" + } ]; + + static getAttributeTypeMap() { + return ServersIdGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/setRulesRequest.ts b/ts_openapi/model/setRulesRequest.ts new file mode 100644 index 0000000..72e99cd --- /dev/null +++ b/ts_openapi/model/setRulesRequest.ts @@ -0,0 +1,35 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Rule } from './rule'; + +export class SetRulesRequest { + /** + * Array of rules + */ + 'rules': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "rules", + "baseName": "rules", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return SetRulesRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/sshKeysGet200Response.ts b/ts_openapi/model/sshKeysGet200Response.ts new file mode 100644 index 0000000..3ebb1b9 --- /dev/null +++ b/ts_openapi/model/sshKeysGet200Response.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { SshKeysGet200ResponseSshKeysInner } from './sshKeysGet200ResponseSshKeysInner'; + +export class SshKeysGet200Response { + 'meta'?: ActionsResponseMeta; + 'sshKeys': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + }, + { + "name": "sshKeys", + "baseName": "ssh_keys", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return SshKeysGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/sshKeysGet200ResponseSshKeysInner.ts b/ts_openapi/model/sshKeysGet200ResponseSshKeysInner.ts new file mode 100644 index 0000000..3ec79b1 --- /dev/null +++ b/ts_openapi/model/sshKeysGet200ResponseSshKeysInner.ts @@ -0,0 +1,79 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class SshKeysGet200ResponseSshKeysInner { + /** + * Point in time when the Resource was created (in ISO-8601 format) + */ + 'created': string; + /** + * Fingerprint of public key + */ + 'fingerprint': string; + /** + * ID of the Resource + */ + 'id': number; + /** + * User-defined labels (key-value pairs) + */ + 'labels': { [key: string]: string; }; + /** + * Name of the Resource. Must be unique per Project. + */ + 'name': string; + /** + * Public key + */ + 'publicKey': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "created", + "baseName": "created", + "type": "string" + }, + { + "name": "fingerprint", + "baseName": "fingerprint", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "labels", + "baseName": "labels", + "type": "{ [key: string]: string; }" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "publicKey", + "baseName": "public_key", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return SshKeysGet200ResponseSshKeysInner.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/sshKeysIdPutRequest.ts b/ts_openapi/model/sshKeysIdPutRequest.ts new file mode 100644 index 0000000..3db532b --- /dev/null +++ b/ts_openapi/model/sshKeysIdPutRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class SshKeysIdPutRequest { + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * New name Name to set + */ + 'name'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return SshKeysIdPutRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/sshKeysPost201Response.ts b/ts_openapi/model/sshKeysPost201Response.ts new file mode 100644 index 0000000..e81de1e --- /dev/null +++ b/ts_openapi/model/sshKeysPost201Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { SshKeysGet200ResponseSshKeysInner } from './sshKeysGet200ResponseSshKeysInner'; + +export class SshKeysPost201Response { + 'sshKey': SshKeysGet200ResponseSshKeysInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "sshKey", + "baseName": "ssh_key", + "type": "SshKeysGet200ResponseSshKeysInner" + } ]; + + static getAttributeTypeMap() { + return SshKeysPost201Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/sshKeysPostRequest.ts b/ts_openapi/model/sshKeysPostRequest.ts new file mode 100644 index 0000000..3187613 --- /dev/null +++ b/ts_openapi/model/sshKeysPostRequest.ts @@ -0,0 +1,52 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class SshKeysPostRequest { + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * Name of the SSH key + */ + 'name': string; + /** + * Public key + */ + 'publicKey': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "publicKey", + "baseName": "public_key", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return SshKeysPostRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/updateCertificateRequest.ts b/ts_openapi/model/updateCertificateRequest.ts new file mode 100644 index 0000000..db18352 --- /dev/null +++ b/ts_openapi/model/updateCertificateRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class UpdateCertificateRequest { + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * New Certificate name + */ + 'name'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UpdateCertificateRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/updateFirewallRequest.ts b/ts_openapi/model/updateFirewallRequest.ts new file mode 100644 index 0000000..9782183 --- /dev/null +++ b/ts_openapi/model/updateFirewallRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class UpdateFirewallRequest { + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * New Firewall name + */ + 'name'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UpdateFirewallRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/updateFloatingIPRequest.ts b/ts_openapi/model/updateFloatingIPRequest.ts new file mode 100644 index 0000000..84dd1f3 --- /dev/null +++ b/ts_openapi/model/updateFloatingIPRequest.ts @@ -0,0 +1,52 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class UpdateFloatingIPRequest { + /** + * New Description to set + */ + 'description'?: string; + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * New unique name to set + */ + 'name'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UpdateFloatingIPRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/updateImageRequest.ts b/ts_openapi/model/updateImageRequest.ts new file mode 100644 index 0000000..6ce441b --- /dev/null +++ b/ts_openapi/model/updateImageRequest.ts @@ -0,0 +1,57 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class UpdateImageRequest { + /** + * New description of Image + */ + 'description'?: string; + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * Destination Image type to convert to + */ + 'type'?: UpdateImageRequest.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "type", + "baseName": "type", + "type": "UpdateImageRequest.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return UpdateImageRequest.attributeTypeMap; + } +} + +export namespace UpdateImageRequest { + export enum TypeEnum { + Snapshot = 'snapshot' + } +} diff --git a/ts_openapi/model/updateLoadBalancerService.ts b/ts_openapi/model/updateLoadBalancerService.ts new file mode 100644 index 0000000..d6f9a40 --- /dev/null +++ b/ts_openapi/model/updateLoadBalancerService.ts @@ -0,0 +1,82 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { LoadBalancerServiceHTTP1 } from './loadBalancerServiceHTTP1'; +import { UpdateLoadBalancerServiceHealthCheck } from './updateLoadBalancerServiceHealthCheck'; + +export class UpdateLoadBalancerService { + /** + * Port the Load Balancer will balance to + */ + 'destinationPort'?: number; + 'healthCheck'?: UpdateLoadBalancerServiceHealthCheck; + 'http'?: LoadBalancerServiceHTTP1; + /** + * Port the Load Balancer listens on + */ + 'listenPort': number; + /** + * Protocol of the Load Balancer + */ + 'protocol'?: UpdateLoadBalancerService.ProtocolEnum; + /** + * Is Proxyprotocol enabled or not + */ + 'proxyprotocol'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "destinationPort", + "baseName": "destination_port", + "type": "number" + }, + { + "name": "healthCheck", + "baseName": "health_check", + "type": "UpdateLoadBalancerServiceHealthCheck" + }, + { + "name": "http", + "baseName": "http", + "type": "LoadBalancerServiceHTTP1" + }, + { + "name": "listenPort", + "baseName": "listen_port", + "type": "number" + }, + { + "name": "protocol", + "baseName": "protocol", + "type": "UpdateLoadBalancerService.ProtocolEnum" + }, + { + "name": "proxyprotocol", + "baseName": "proxyprotocol", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return UpdateLoadBalancerService.attributeTypeMap; + } +} + +export namespace UpdateLoadBalancerService { + export enum ProtocolEnum { + Tcp = 'tcp', + Http = 'http', + Https = 'https' + } +} diff --git a/ts_openapi/model/updateLoadBalancerServiceHealthCheck.ts b/ts_openapi/model/updateLoadBalancerServiceHealthCheck.ts new file mode 100644 index 0000000..3d6c40e --- /dev/null +++ b/ts_openapi/model/updateLoadBalancerServiceHealthCheck.ts @@ -0,0 +1,86 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { UpdateLoadBalancerServiceHealthCheckHttp } from './updateLoadBalancerServiceHealthCheckHttp'; + +/** +* Service health check +*/ +export class UpdateLoadBalancerServiceHealthCheck { + 'http'?: UpdateLoadBalancerServiceHealthCheckHttp; + /** + * Time interval in seconds health checks are performed + */ + 'interval'?: number; + /** + * Port the health check will be performed on + */ + 'port'?: number; + /** + * Type of the health check + */ + 'protocol'?: UpdateLoadBalancerServiceHealthCheck.ProtocolEnum; + /** + * Unsuccessful retries needed until a target is considered unhealthy; an unhealthy target needs the same number of successful retries to become healthy again + */ + 'retries'?: number; + /** + * Time in seconds after an attempt is considered a timeout + */ + 'timeout'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "http", + "baseName": "http", + "type": "UpdateLoadBalancerServiceHealthCheckHttp" + }, + { + "name": "interval", + "baseName": "interval", + "type": "number" + }, + { + "name": "port", + "baseName": "port", + "type": "number" + }, + { + "name": "protocol", + "baseName": "protocol", + "type": "UpdateLoadBalancerServiceHealthCheck.ProtocolEnum" + }, + { + "name": "retries", + "baseName": "retries", + "type": "number" + }, + { + "name": "timeout", + "baseName": "timeout", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return UpdateLoadBalancerServiceHealthCheck.attributeTypeMap; + } +} + +export namespace UpdateLoadBalancerServiceHealthCheck { + export enum ProtocolEnum { + Tcp = 'tcp', + Http = 'http' + } +} diff --git a/ts_openapi/model/updateLoadBalancerServiceHealthCheckHttp.ts b/ts_openapi/model/updateLoadBalancerServiceHealthCheckHttp.ts new file mode 100644 index 0000000..6188214 --- /dev/null +++ b/ts_openapi/model/updateLoadBalancerServiceHealthCheckHttp.ts @@ -0,0 +1,73 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Additional configuration for protocol http +*/ +export class UpdateLoadBalancerServiceHealthCheckHttp { + /** + * Host header to send in the HTTP request. May not contain spaces, percent or backslash symbols. Can be null, in that case no host header is sent. + */ + 'domain'?: string | null; + /** + * HTTP path to use for health checks. May not contain literal spaces, use percent-encoding instead. + */ + 'path'?: string; + /** + * String that must be contained in HTTP response in order to pass the health check + */ + 'response'?: string; + /** + * List of returned HTTP status codes in order to pass the health check. Supports the wildcards `?` for exactly one character and `*` for multiple ones. + */ + 'statusCodes'?: Array; + /** + * Use HTTPS for health check + */ + 'tls'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "domain", + "baseName": "domain", + "type": "string" + }, + { + "name": "path", + "baseName": "path", + "type": "string" + }, + { + "name": "response", + "baseName": "response", + "type": "string" + }, + { + "name": "statusCodes", + "baseName": "status_codes", + "type": "Array" + }, + { + "name": "tls", + "baseName": "tls", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return UpdateLoadBalancerServiceHealthCheckHttp.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/updateNetworkRequest.ts b/ts_openapi/model/updateNetworkRequest.ts new file mode 100644 index 0000000..e704106 --- /dev/null +++ b/ts_openapi/model/updateNetworkRequest.ts @@ -0,0 +1,50 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { UpdateNetworkRequestLabels } from './updateNetworkRequestLabels'; + +export class UpdateNetworkRequest { + /** + * Indicates if the routes from this network should be exposed to the vSwitch connection. The exposing only takes effect if a vSwitch connection is active. + */ + 'exposeRoutesToVswitch'?: boolean; + 'labels'?: UpdateNetworkRequestLabels; + /** + * New network name + */ + 'name'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "exposeRoutesToVswitch", + "baseName": "expose_routes_to_vswitch", + "type": "boolean" + }, + { + "name": "labels", + "baseName": "labels", + "type": "UpdateNetworkRequestLabels" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UpdateNetworkRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/updateNetworkRequestLabels.ts b/ts_openapi/model/updateNetworkRequestLabels.ts new file mode 100644 index 0000000..7cd02d5 --- /dev/null +++ b/ts_openapi/model/updateNetworkRequestLabels.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* User-defined labels (key-value pairs) +*/ +export class UpdateNetworkRequestLabels { + 'labelkey'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labelkey", + "baseName": "labelkey", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UpdateNetworkRequestLabels.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/updatePlacementGroupRequest.ts b/ts_openapi/model/updatePlacementGroupRequest.ts new file mode 100644 index 0000000..a408ff5 --- /dev/null +++ b/ts_openapi/model/updatePlacementGroupRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class UpdatePlacementGroupRequest { + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * New PlacementGroup name + */ + 'name'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UpdatePlacementGroupRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/updatePrimaryIPRequest.ts b/ts_openapi/model/updatePrimaryIPRequest.ts new file mode 100644 index 0000000..29201b0 --- /dev/null +++ b/ts_openapi/model/updatePrimaryIPRequest.ts @@ -0,0 +1,52 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class UpdatePrimaryIPRequest { + /** + * Delete this Primary IP when the resource it is assigned to is deleted + */ + 'autoDelete'?: boolean; + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * New unique name to set + */ + 'name'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "autoDelete", + "baseName": "auto_delete", + "type": "boolean" + }, + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UpdatePrimaryIPRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/updateServerRequest.ts b/ts_openapi/model/updateServerRequest.ts new file mode 100644 index 0000000..4f55f34 --- /dev/null +++ b/ts_openapi/model/updateServerRequest.ts @@ -0,0 +1,43 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class UpdateServerRequest { + /** + * User-defined labels (key-value pairs) + */ + 'labels'?: object; + /** + * New name to set + */ + 'name'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labels", + "baseName": "labels", + "type": "object" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UpdateServerRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/updateVolumeRequest.ts b/ts_openapi/model/updateVolumeRequest.ts new file mode 100644 index 0000000..724db32 --- /dev/null +++ b/ts_openapi/model/updateVolumeRequest.ts @@ -0,0 +1,41 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { UpdateNetworkRequestLabels } from './updateNetworkRequestLabels'; + +export class UpdateVolumeRequest { + 'labels'?: UpdateNetworkRequestLabels; + /** + * New Volume name + */ + 'name'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "labels", + "baseName": "labels", + "type": "UpdateNetworkRequestLabels" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return UpdateVolumeRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/volumesGet200Response.ts b/ts_openapi/model/volumesGet200Response.ts new file mode 100644 index 0000000..5dbefb8 --- /dev/null +++ b/ts_openapi/model/volumesGet200Response.ts @@ -0,0 +1,39 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { ActionsResponseMeta } from './actionsResponseMeta'; +import { VolumesGet200ResponseVolumesInner } from './volumesGet200ResponseVolumesInner'; + +export class VolumesGet200Response { + 'meta'?: ActionsResponseMeta; + 'volumes': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "meta", + "baseName": "meta", + "type": "ActionsResponseMeta" + }, + { + "name": "volumes", + "baseName": "volumes", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return VolumesGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/volumesGet200ResponseVolumesInner.ts b/ts_openapi/model/volumesGet200ResponseVolumesInner.ts new file mode 100644 index 0000000..5503216 --- /dev/null +++ b/ts_openapi/model/volumesGet200ResponseVolumesInner.ts @@ -0,0 +1,126 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { FloatingIpsGet200ResponseFloatingIpsInnerProtection } from './floatingIpsGet200ResponseFloatingIpsInnerProtection'; +import { VolumesGet200ResponseVolumesInnerLocation } from './volumesGet200ResponseVolumesInnerLocation'; + +export class VolumesGet200ResponseVolumesInner { + /** + * Point in time when the Resource was created (in ISO-8601 format) + */ + 'created': string; + /** + * Filesystem of the Volume if formatted on creation, null if not formatted on creation + */ + 'format': string | null; + /** + * ID of the Resource + */ + 'id': number; + /** + * User-defined labels (key-value pairs) + */ + 'labels': { [key: string]: string; }; + /** + * Device path on the file system for the Volume + */ + 'linuxDevice': string; + 'location': VolumesGet200ResponseVolumesInnerLocation; + /** + * Name of the Resource. Must be unique per Project. + */ + 'name': string; + 'protection': FloatingIpsGet200ResponseFloatingIpsInnerProtection; + /** + * ID of the Server the Volume is attached to, null if it is not attached at all + */ + 'server': number | null; + /** + * Size in GB of the Volume + */ + 'size': number; + /** + * Current status of the Volume + */ + 'status': VolumesGet200ResponseVolumesInner.StatusEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "created", + "baseName": "created", + "type": "string" + }, + { + "name": "format", + "baseName": "format", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "labels", + "baseName": "labels", + "type": "{ [key: string]: string; }" + }, + { + "name": "linuxDevice", + "baseName": "linux_device", + "type": "string" + }, + { + "name": "location", + "baseName": "location", + "type": "VolumesGet200ResponseVolumesInnerLocation" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "protection", + "baseName": "protection", + "type": "FloatingIpsGet200ResponseFloatingIpsInnerProtection" + }, + { + "name": "server", + "baseName": "server", + "type": "number" + }, + { + "name": "size", + "baseName": "size", + "type": "number" + }, + { + "name": "status", + "baseName": "status", + "type": "VolumesGet200ResponseVolumesInner.StatusEnum" + } ]; + + static getAttributeTypeMap() { + return VolumesGet200ResponseVolumesInner.attributeTypeMap; + } +} + +export namespace VolumesGet200ResponseVolumesInner { + export enum StatusEnum { + Creating = 'creating', + Available = 'available' + } +} diff --git a/ts_openapi/model/volumesGet200ResponseVolumesInnerLocation.ts b/ts_openapi/model/volumesGet200ResponseVolumesInnerLocation.ts new file mode 100644 index 0000000..16c3ff6 --- /dev/null +++ b/ts_openapi/model/volumesGet200ResponseVolumesInnerLocation.ts @@ -0,0 +1,100 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +/** +* Location of the Volume. Volume can only be attached to Servers in the same Location. +*/ +export class VolumesGet200ResponseVolumesInnerLocation { + /** + * City the Location is closest to + */ + 'city': string; + /** + * ISO 3166-1 alpha-2 code of the country the Location resides in + */ + 'country': string; + /** + * Description of the Location + */ + 'description': string; + /** + * ID of the Location + */ + 'id': number; + /** + * Latitude of the city closest to the Location + */ + 'latitude': number; + /** + * Longitude of the city closest to the Location + */ + 'longitude': number; + /** + * Unique identifier of the Location + */ + 'name': string; + /** + * Name of network zone this Location resides in + */ + 'networkZone': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "city", + "baseName": "city", + "type": "string" + }, + { + "name": "country", + "baseName": "country", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "number" + }, + { + "name": "latitude", + "baseName": "latitude", + "type": "number" + }, + { + "name": "longitude", + "baseName": "longitude", + "type": "number" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "networkZone", + "baseName": "network_zone", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return VolumesGet200ResponseVolumesInnerLocation.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/volumesIdActionsChangeProtectionPostRequest.ts b/ts_openapi/model/volumesIdActionsChangeProtectionPostRequest.ts new file mode 100644 index 0000000..d4432b9 --- /dev/null +++ b/ts_openapi/model/volumesIdActionsChangeProtectionPostRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class VolumesIdActionsChangeProtectionPostRequest { + /** + * If true, prevents the Volume from being deleted + */ + '_delete'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "_delete", + "baseName": "delete", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return VolumesIdActionsChangeProtectionPostRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/volumesIdActionsResizePostRequest.ts b/ts_openapi/model/volumesIdActionsResizePostRequest.ts new file mode 100644 index 0000000..71e3dcc --- /dev/null +++ b/ts_openapi/model/volumesIdActionsResizePostRequest.ts @@ -0,0 +1,34 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class VolumesIdActionsResizePostRequest { + /** + * New Volume size in GB (must be greater than current size) + */ + 'size': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "size", + "baseName": "size", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return VolumesIdActionsResizePostRequest.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/volumesIdGet200Response.ts b/ts_openapi/model/volumesIdGet200Response.ts new file mode 100644 index 0000000..7d05168 --- /dev/null +++ b/ts_openapi/model/volumesIdGet200Response.ts @@ -0,0 +1,32 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { VolumesGet200ResponseVolumesInner } from './volumesGet200ResponseVolumesInner'; + +export class VolumesIdGet200Response { + 'volume': VolumesGet200ResponseVolumesInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "volume", + "baseName": "volume", + "type": "VolumesGet200ResponseVolumesInner" + } ]; + + static getAttributeTypeMap() { + return VolumesIdGet200Response.attributeTypeMap; + } +} + diff --git a/ts_openapi/model/volumesPost201Response.ts b/ts_openapi/model/volumesPost201Response.ts new file mode 100644 index 0000000..59e4cc5 --- /dev/null +++ b/ts_openapi/model/volumesPost201Response.ts @@ -0,0 +1,45 @@ +/** + * Hetzner Cloud API + * This is the official documentation for the Hetzner Cloud API. ## Introduction The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses. As an alternative to working directly with our API you may also consider to use: - Our CLI program [hcloud](https://github.com/hetznercloud/cli) - Our [library for Go](https://github.com/hetznercloud/hcloud-go) - Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following: - The type of integration you would like to develop - Link to the GitHub repo you will use for the Project - Link to some other Open Source work you have already done (if you have done so) ## Getting Started To get started using the API you first need an API token. Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is `LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj`. You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using [curl](https://curl.se/). Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like `servers` inside the example response. A response can also contain a `meta` object with information like [Pagination](#pagination). **Example Request** ```bash curl -H \"Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj\" \\ https://api.hetzner.cloud/v1/servers ``` **Example Response** ```json { \"servers\": [], \"meta\": { \"pagination\": { \"page\": 1, \"per_page\": 25, \"previous_page\": null, \"next_page\": null, \"last_page\": 1, \"total_entries\": 0 } } } ``` ## Authentication All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the `Authorization` HTTP header. To create a new API token for your Project, switch into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API Tokens`, and generate a new token. **Example Authorization header** ```http Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj ``` ## Errors Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code. The error response contains the following keys: | Keys | Meaning | | --------- | --------------------------------------------------------------------- | | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An object providing for details on the error (schema depends on code) | **Example response** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` ### Error Codes | Code | Description | | ------------------------- | -------------------------------------------------------------------------------- | | `forbidden` | Insufficient permissions for this request | | `unauthorized` | Request was made with an invalid or unknown token | | `invalid_input` | Error while parsing or processing the input | | `json_error` | Invalid JSON input in your request | | `locked` | The item you are trying to access is locked (there is already an Action running) | | `not_found` | Entity not found | | `rate_limit_exceeded` | Error when sending too many requests | | `resource_limit_exceeded` | Error when exceeding the maximum quantity of a resource for an account | | `resource_unavailable` | The requested resource is currently unavailable | | `server_error` | Error within the API backend | | `service_error` | Error within a service | | `uniqueness_error` | One or more of the objects fields must be unique | | `protected` | The Action you are trying to start is protected for this resource | | `maintenance` | Cannot perform operation due to maintenance | | `conflict` | The resource has changed during the request, please retry | | `unsupported_error` | The corresponding resource does not support the Action | | `token_readonly` | The token is only allowed to perform GET requests | | `unavailable` | A service or product is currently not available | **invalid_input** ```json { \"error\": { \"code\": \"invalid_input\", \"message\": \"invalid input in field \'broken_field\': is too long\", \"details\": { \"fields\": [ { \"name\": \"broken_field\", \"messages\": [\"is too long\"] } ] } } } ``` **uniqueness_error** ```json { \"error\": { \"code\": \"uniqueness_error\", \"message\": \"SSH key with the same fingerprint already exists\", \"details\": { \"fields\": [ { \"name\": \"public_key\" } ] } } } ``` **resource_limit_exceeded** ```json { \"error\": { \"code\": \"resource_limit_exceeded\", \"message\": \"project limit exceeded\", \"details\": { \"limits\": [ { \"name\": \"project_limit\" } ] } } } ``` ## Labels Labels are `key/value` pairs that can be attached to all resources. Valid label keys have two segments: an optional prefix and name, separated by a slash (`/`). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (`.`), not longer than 253 characters in total, followed by a slash (`/`). Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. The `hetzner.cloud/` prefix is reserved and cannot be used. **Example Labels** ```json { \"labels\": { \"environment\": \"development\", \"service\": \"backend\", \"example.com/my\": \"label\", \"just-a-key\": \"\" } } ``` ## Label Selector For resources with labels, you can filter resources by their labels using the label selector query language. | Expression | Meaning | | -------------------- | ---------------------------------------------------- | | `k==v` / `k=v` | Value of key `k` does equal value `v` | | `k!=v` | Value of key `k` does not equal value `v` | | `k` | Key `k` is present | | `!k` | Key `k` is not present | | `k in (v1,v2,v3)` | Value of key `k` is `v1`, `v2`, or `v3` | | `k notin (v1,v2,v3)` | Value of key `k` is neither `v1`, nor `v2`, nor `v3` | | `k1==v,!k2` | Value of key `k1` is `v` and key `k2` is not present | ### Examples - Returns all resources that have a `env=production` label and that don\'t have a `type=database` label: `env=production,type!=database` - Returns all resources that have a `env=testing` or `env=staging` label: `env in (testing,staging)` - Returns all resources that don\'t have a `type` label: `!type` ## Pagination Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters: - A `page` parameter specifies the page to fetch. The number of the first page is 1. - A `per_page` parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation. Responses contain a `Link` header with pagination information. Additionally, if the response body is JSON and the root object is an object, that object has a `pagination` object inside the `meta` object with pagination information: **Example Pagination** ```json { \"servers\": [...], \"meta\": { \"pagination\": { \"page\": 2, \"per_page\": 25, \"previous_page\": 1, \"next_page\": 3, \"last_page\": 4, \"total_entries\": 100 } } } ``` The keys `previous_page`, `next_page`, `last_page`, and `total_entries` may be `null` when on the first page, last page, or when the total number of entries is unknown. **Example Pagination Link header** ```http Link: ; rel=\"prev\", ; rel=\"next\", ; rel=\"last\" ``` Line breaks have been added for display purposes only and responses may only contain some of the above `rel` values. ## Rate Limiting All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a `429 Too Many Requests` error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status. - The `RateLimit-Limit` header contains the total number of requests you can perform per hour. - The `RateLimit-Remaining` header contains the number of requests remaining in the current rate limit time frame. - The `RateLimit-Reset` header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again. The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second. ## Server Metadata Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available: | Data | Format | Contents | | ----------------- | ------ | ------------------------------------------------------------ | | hostname | text | Name of the Server as set in the api | | instance-id | number | ID of the server | | public-ipv4 | text | Primary public IPv4 address | | private-networks | yaml | Details about the private networks the Server is attached to | | availability-zone | text | Name of the availability zone that Server runs in | | region | text | Network zone, e.g. eu-central | **Example: Summary** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata ``` ```yaml availability-zone: hel1-dc2 hostname: my-server instance-id: 42 public-ipv4: 1.2.3.4 region: eu-central ``` **Example: Hostname** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/hostname my-server ``` **Example: Instance ID** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/instance-id 42 ``` **Example: Public IPv4** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv4 1.2.3.4 ``` **Example: Private Networks** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/private-networks ``` ```yaml - ip: 10.0.0.2 alias_ips: [10.0.0.3, 10.0.0.4] interface_num: 1 mac_address: 86:00:00:2a:7d:e0 network_id: 1234 network_name: nw-test1 network: 10.0.0.0/8 subnet: 10.0.0.0/24 gateway: 10.0.0.1 - ip: 192.168.0.2 alias_ips: [] interface_num: 2 mac_address: 86:00:00:2a:7d:e1 network_id: 4321 network_name: nw-test2 network: 192.168.0.0/16 subnet: 192.168.0.0/24 gateway: 192.168.0.1 ``` **Example: Availability Zone** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/availability-zone hel1-dc2 ``` **Example: Region** ```bash $ curl http://169.254.169.254/hetzner/v1/metadata/region eu-central ``` ## Sorting Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the `sort` query string parameter. You can sort by multiple fields. You can set the sort direction by appending `:asc` or `:desc` to the field name. By default, ascending sorting is used. **Example: Sorting** ``` https://api.hetzner.cloud/v1/actions?sort=status https://api.hetzner.cloud/v1/actions?sort=status:asc https://api.hetzner.cloud/v1/actions?sort=status:desc https://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc ``` ## Deprecation Notices You can find all announced deprecations in our [Changelog](/changelog). + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { Action } from './action'; +import { VolumesGet200ResponseVolumesInner } from './volumesGet200ResponseVolumesInner'; + +export class VolumesPost201Response { + 'action': Action; + 'nextActions': Array; + 'volume': VolumesGet200ResponseVolumesInner; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "action", + "baseName": "action", + "type": "Action" + }, + { + "name": "nextActions", + "baseName": "next_actions", + "type": "Array" + }, + { + "name": "volume", + "baseName": "volume", + "type": "VolumesGet200ResponseVolumesInner" + } ]; + + static getAttributeTypeMap() { + return VolumesPost201Response.attributeTypeMap; + } +} + diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..dfe5a55 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "experimentalDecorators": true, + "useDefineForClassFields": false, + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "esModuleInterop": true, + "verbatimModuleSyntax": true + }, + "exclude": [ + "dist_*/**/*.d.ts" + ] +}