|
| 1 | +import { apiCall } from "../core"; |
| 2 | +import type { |
| 3 | + BackupFrequency, |
| 4 | + Country, |
| 5 | + GetAppListResponse, |
| 6 | + GetMonitorDurationsResponse, |
| 7 | + GetMonitorTargetsResponse, |
| 8 | + GetPackageListResponse, |
| 9 | + GetProviderListResponse, |
| 10 | + GetRegionListResponse, |
| 11 | + GetServerSizesListResponse, |
| 12 | + GetSettingsListResponse, |
| 13 | +} from "./types"; |
| 14 | + |
| 15 | +/** |
| 16 | + * Gets a list of available cloud providers. |
| 17 | + * @returns Promise<GetProviderListResponse> - The response with cloud providers. |
| 18 | + */ |
| 19 | +export function getProviderList(): Promise<GetProviderListResponse> { |
| 20 | + return apiCall("/providers"); |
| 21 | +} |
| 22 | + |
| 23 | +/** |
| 24 | + * Gets a list of regions. |
| 25 | + * @returns Promise<GetRegionListResponse> - The response with regions. |
| 26 | + */ |
| 27 | +export function getRegionList(): Promise<GetRegionListResponse> { |
| 28 | + return apiCall("/regions"); |
| 29 | +} |
| 30 | + |
| 31 | +/** |
| 32 | + * Gets a list of server sizes available. |
| 33 | + * @returns Promise<GetServerSizesListResponse> - The response with server sizes. |
| 34 | + */ |
| 35 | +export function getServerSizesList(): Promise<GetServerSizesListResponse> { |
| 36 | + return apiCall("/server_sizes"); |
| 37 | +} |
| 38 | + |
| 39 | +/** |
| 40 | + * Gets a list of available apps and their versions. |
| 41 | + * @returns Promise<GetAppListResponse> - The response with available apps and their versions. |
| 42 | + */ |
| 43 | +export function getAppList(): Promise<GetAppListResponse> { |
| 44 | + return apiCall("/app"); |
| 45 | +} |
| 46 | + |
| 47 | +/** |
| 48 | + * Gets a list of available packages and versions. |
| 49 | + * @returns Promise<GetPackageListResponse> - The response with available packages and versions. |
| 50 | + */ |
| 51 | +export function getPackageList(): Promise<GetPackageListResponse> { |
| 52 | + return apiCall("/packages"); |
| 53 | +} |
| 54 | + |
| 55 | +/** |
| 56 | + * Gets a list of available settings and corresponding values. |
| 57 | + * @returns Promise<GetSettingsListResponse> - The response with settings. |
| 58 | + */ |
| 59 | +export function getSettingsList(): Promise<GetSettingsListResponse> { |
| 60 | + return apiCall("/settings"); |
| 61 | +} |
| 62 | + |
| 63 | +/** |
| 64 | + * Gets possible backup frequencies. |
| 65 | + * @returns Promise<GetBackupFrequenciesResponse> - The response with backup frequencies. |
| 66 | + */ |
| 67 | +export function getBackupFrequencies(): Promise<BackupFrequency[]> { |
| 68 | + return apiCall("/backup-frequencies"); |
| 69 | +} |
| 70 | + |
| 71 | +/** |
| 72 | + * Gets the list of countries. |
| 73 | + * @returns Promise<GetCountriesListResponse> - The response with the list of countries. |
| 74 | + */ |
| 75 | +export function getCountriesList(): Promise<Country[]> { |
| 76 | + return apiCall("/countries"); |
| 77 | +} |
| 78 | + |
| 79 | +/** |
| 80 | + * Gets possible monitoring durations. |
| 81 | + * @returns Promise<GetMonitorDurationsResponse> - The response with monitoring durations. |
| 82 | + */ |
| 83 | +export function getMonitorDurations(): Promise<GetMonitorDurationsResponse> { |
| 84 | + return apiCall("/monitor-durations"); |
| 85 | +} |
| 86 | + |
| 87 | +/** |
| 88 | + * Gets a list of server monitoring graph types. |
| 89 | + * @returns Promise<GetMonitorTargetsResponse> - The response with monitoring targets. |
| 90 | + */ |
| 91 | +export function getMonitorTargets(): Promise<GetMonitorTargetsResponse> { |
| 92 | + return apiCall("/monitor-targets"); |
| 93 | +} |
0 commit comments