@pulumi/linode
Version:
A Pulumi package for creating and managing linode cloud resources.
148 lines • 4.01 kB
JavaScript
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getInstancesOutput = exports.getInstances = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* 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`
*/
function getInstances(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("linode:index/getInstances:getInstances", {
"filters": args.filters,
"order": args.order,
"orderBy": args.orderBy,
}, opts);
}
exports.getInstances = getInstances;
/**
* 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`
*/
function getInstancesOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("linode:index/getInstances:getInstances", {
"filters": args.filters,
"order": args.order,
"orderBy": args.orderBy,
}, opts);
}
exports.getInstancesOutput = getInstancesOutput;
//# sourceMappingURL=getInstances.js.map
;