@pulumi/linode
Version:
A Pulumi package for creating and managing linode cloud resources.
167 lines (166 loc) • 4.49 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Provides information about Linode instances that match a set of filters.
* For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/get-linode-instances).
*
* ## Example Usage
*
* Get information about all Linode instances with a certain label and tag:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as linode from "@pulumi/linode";
*
* const my_instances = linode.getInstances({
* filters: [
* {
* name: "label",
* values: [
* "my-label",
* "my-other-label",
* ],
* },
* {
* name: "tags",
* values: ["my-tag"],
* },
* ],
* });
* export const instanceId = my_instances.then(my_instances => my_instances.instances?.[0]?.id);
* ```
*
* Get information about all Linode instances associated with the current token:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as linode from "@pulumi/linode";
*
* const all_instances = linode.getInstances({});
* export const instanceIds = all_instances.then(all_instances => all_instances.instances.map(__item => __item.id));
* ```
*
* ## Filterable Fields
*
* * `group`
*
* * `id`
*
* * `image`
*
* * `label`
*
* * `region`
*
* * `status`
*
* * `tags`
*
* * `type`
*
* * `watchdogEnabled`
*/
export declare function getInstances(args?: GetInstancesArgs, opts?: pulumi.InvokeOptions): Promise<GetInstancesResult>;
/**
* A collection of arguments for invoking getInstances.
*/
export interface GetInstancesArgs {
filters?: inputs.GetInstancesFilter[];
/**
* The order in which results should be returned. (`asc`, `desc`; default `asc`)
*/
order?: string;
/**
* The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
*/
orderBy?: string;
}
/**
* A collection of values returned by getInstances.
*/
export interface GetInstancesResult {
readonly filters?: outputs.GetInstancesFilter[];
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly instances: outputs.GetInstancesInstance[];
readonly order?: string;
readonly orderBy?: string;
}
/**
* Provides information about Linode instances that match a set of filters.
* For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/get-linode-instances).
*
* ## Example Usage
*
* Get information about all Linode instances with a certain label and tag:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as linode from "@pulumi/linode";
*
* const my_instances = linode.getInstances({
* filters: [
* {
* name: "label",
* values: [
* "my-label",
* "my-other-label",
* ],
* },
* {
* name: "tags",
* values: ["my-tag"],
* },
* ],
* });
* export const instanceId = my_instances.then(my_instances => my_instances.instances?.[0]?.id);
* ```
*
* Get information about all Linode instances associated with the current token:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as linode from "@pulumi/linode";
*
* const all_instances = linode.getInstances({});
* export const instanceIds = all_instances.then(all_instances => all_instances.instances.map(__item => __item.id));
* ```
*
* ## Filterable Fields
*
* * `group`
*
* * `id`
*
* * `image`
*
* * `label`
*
* * `region`
*
* * `status`
*
* * `tags`
*
* * `type`
*
* * `watchdogEnabled`
*/
export declare function getInstancesOutput(args?: GetInstancesOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetInstancesResult>;
/**
* A collection of arguments for invoking getInstances.
*/
export interface GetInstancesOutputArgs {
filters?: pulumi.Input<pulumi.Input<inputs.GetInstancesFilterArgs>[]>;
/**
* The order in which results should be returned. (`asc`, `desc`; default `asc`)
*/
order?: pulumi.Input<string>;
/**
* The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
*/
orderBy?: pulumi.Input<string>;
}