UNPKG

@equinix-labs/pulumi-equinix

Version:

A Pulumi package for creating and managing equinix cloud resources.

120 lines 4.08 kB
"use strict"; // *** 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.getDevicesOutput = exports.getDevices = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * The datasource can be used to find a list of devices which meet filter criteria. * * If you need to fetch a single device by ID or by project ID and hostname, use the equinix.metal.Device datasource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@equinix-labs/pulumi-equinix"; * * const example = equinix.metal.getDevices({ * projectId: local.project_id, * filters: [ * { * attribute: "plan", * values: ["c3.small.x86"], * }, * { * attribute: "metro", * values: [ * "da", * "sv", * ], * }, * ], * }); * export const devices = example.then(example => example.devices); * ``` * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@equinix-labs/pulumi-equinix"; * * const example = equinix.metal.getDevices({ * search: "database", * }); * export const devices = example.then(example => example.devices); * ``` * * ## search vs filter * * The difference between `search` and `filter` is that `search` is an API parameter, interpreted by the Equinix Metal service. The "filter" arguments will reduce the API list (or search) results by applying client-side filtering, within this provider. */ function getDevices(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("equinix:metal/getDevices:getDevices", { "filters": args.filters, "organizationId": args.organizationId, "projectId": args.projectId, "search": args.search, "sorts": args.sorts, }, opts); } exports.getDevices = getDevices; /** * The datasource can be used to find a list of devices which meet filter criteria. * * If you need to fetch a single device by ID or by project ID and hostname, use the equinix.metal.Device datasource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@equinix-labs/pulumi-equinix"; * * const example = equinix.metal.getDevices({ * projectId: local.project_id, * filters: [ * { * attribute: "plan", * values: ["c3.small.x86"], * }, * { * attribute: "metro", * values: [ * "da", * "sv", * ], * }, * ], * }); * export const devices = example.then(example => example.devices); * ``` * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@equinix-labs/pulumi-equinix"; * * const example = equinix.metal.getDevices({ * search: "database", * }); * export const devices = example.then(example => example.devices); * ``` * * ## search vs filter * * The difference between `search` and `filter` is that `search` is an API parameter, interpreted by the Equinix Metal service. The "filter" arguments will reduce the API list (or search) results by applying client-side filtering, within this provider. */ function getDevicesOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("equinix:metal/getDevices:getDevices", { "filters": args.filters, "organizationId": args.organizationId, "projectId": args.projectId, "search": args.search, "sorts": args.sorts, }, opts); } exports.getDevicesOutput = getDevicesOutput; //# sourceMappingURL=getDevices.js.map