@pulumi/hcloud
Version:
A Pulumi package for creating and managing hcloud cloud resources.
202 lines (201 loc) • 5.8 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as hcloud from "@pulumi/hcloud";
*
* const s1 = hcloud.getServer({
* name: "my-server",
* });
* const s2 = hcloud.getServer({
* id: 123,
* });
* const s3 = hcloud.getServer({
* withSelector: "key=value",
* });
* ```
*/
export declare function getServer(args?: GetServerArgs, opts?: pulumi.InvokeOptions): Promise<GetServerResult>;
/**
* A collection of arguments for invoking getServer.
*/
export interface GetServerArgs {
/**
* ID of the server.
*/
id?: number;
/**
* Name of the server.
*/
name?: string;
/**
* (map) Private Network the server is attached to.
*/
networks?: inputs.GetServerNetwork[];
/**
* (Optional, string) Placement Group ID the server is assigned to.
*/
placementGroupId?: number;
/**
* @deprecated Please use the withSelector property instead.
*/
selector?: string;
/**
* Label Selector. For more information about possible values, visit the [Hetzner Cloud Documentation](https://docs.hetzner.cloud/#overview-label-selector).
*/
withSelector?: string;
/**
* List only servers with the specified status, could contain `initializing`, `starting`, `running`, `stopping`, `off`, `deleting`, `rebuilding`, `migrating`, `unknown`.
*/
withStatuses?: string[];
}
/**
* A collection of values returned by getServer.
*/
export interface GetServerResult {
/**
* (string) The backup window of the server, if enabled.
*/
readonly backupWindow: string;
/**
* (bool) Whether backups are enabled.
*/
readonly backups: boolean;
/**
* (string) The datacenter name. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-datacenters-are-there) for more details about datacenters.
*/
readonly datacenter: string;
/**
* (bool) Whether delete protection is enabled.
*/
readonly deleteProtection: boolean;
/**
* (Optional, list) Firewall IDs the server is attached to.
*/
readonly firewallIds: number[];
/**
* (int) Unique ID of the server.
*/
readonly id: number;
/**
* (string) Name or ID of the image the server was created from.
*/
readonly image: string;
/**
* (string) The IPv4 address.
*/
readonly ipv4Address: string;
/**
* (string) The first IPv6 address of the assigned network.
*/
readonly ipv6Address: string;
/**
* (string) The IPv6 network.
*/
readonly ipv6Network: string;
/**
* (string) ID or Name of the mounted ISO image. Architecture of ISO must equal the server (type) architecture.
*/
readonly iso: string;
/**
* (map) User-defined labels (key-value pairs)
*/
readonly labels: {
[key: string]: string;
};
/**
* (string) The location name. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
*/
readonly location: string;
/**
* (string) Name of the server.
*/
readonly name: string;
/**
* (map) Private Network the server is attached to.
*/
readonly networks?: outputs.GetServerNetwork[];
/**
* (Optional, string) Placement Group ID the server is assigned to.
*/
readonly placementGroupId?: number;
/**
* (int) The size of the primary disk in GB.
*/
readonly primaryDiskSize: number;
/**
* (bool) Whether rebuild protection is enabled.
*/
readonly rebuildProtection: boolean;
readonly rescue: string;
/**
* @deprecated Please use the withSelector property instead.
*/
readonly selector?: string;
/**
* (string) Name of the server type.
*/
readonly serverType: string;
/**
* (string) The status of the server.
*/
readonly status: string;
readonly withSelector?: string;
readonly withStatuses?: string[];
}
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as hcloud from "@pulumi/hcloud";
*
* const s1 = hcloud.getServer({
* name: "my-server",
* });
* const s2 = hcloud.getServer({
* id: 123,
* });
* const s3 = hcloud.getServer({
* withSelector: "key=value",
* });
* ```
*/
export declare function getServerOutput(args?: GetServerOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetServerResult>;
/**
* A collection of arguments for invoking getServer.
*/
export interface GetServerOutputArgs {
/**
* ID of the server.
*/
id?: pulumi.Input<number>;
/**
* Name of the server.
*/
name?: pulumi.Input<string>;
/**
* (map) Private Network the server is attached to.
*/
networks?: pulumi.Input<pulumi.Input<inputs.GetServerNetworkArgs>[]>;
/**
* (Optional, string) Placement Group ID the server is assigned to.
*/
placementGroupId?: pulumi.Input<number>;
/**
* @deprecated Please use the withSelector property instead.
*/
selector?: pulumi.Input<string>;
/**
* Label Selector. For more information about possible values, visit the [Hetzner Cloud Documentation](https://docs.hetzner.cloud/#overview-label-selector).
*/
withSelector?: pulumi.Input<string>;
/**
* List only servers with the specified status, could contain `initializing`, `starting`, `running`, `stopping`, `off`, `deleting`, `rebuilding`, `migrating`, `unknown`.
*/
withStatuses?: pulumi.Input<pulumi.Input<string>[]>;
}