UNPKG

@pulumi/scm

Version:

A Pulumi package for managing resources on Strata Cloud Manager.. Based on terraform-provider-scm: version v0.2.1

90 lines 3.51 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getServiceListOutput = exports.getServiceList = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Retrieves a listing of config items. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scm from "@pulumi/scm"; * * // Data source to fetch all services in the "Shared" folder. * const allSharedServices = scm.getServiceList({ * folder: "All", * }); * export const allSharedServicesMap = allSharedServices.then(allSharedServices => .reduce((__obj, svc) => ({ ...__obj, [svc.name]: svc }))); * // Example of using pagination to get the first 5 services. * const paginatedServices = scm.getServiceList({ * folder: "All", * limit: 5, * offset: 0, * }); * export const paginatedServicesList = paginatedServices.then(paginatedServices => paginatedServices.datas); * export const paginatedServicesDetails = { * totalInFolder: paginatedServices.then(paginatedServices => paginatedServices.total), * limitUsed: paginatedServices.then(paginatedServices => paginatedServices.limit), * offsetUsed: paginatedServices.then(paginatedServices => paginatedServices.offset), * }; * ``` */ function getServiceList(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("scm:index/getServiceList:getServiceList", { "device": args.device, "folder": args.folder, "limit": args.limit, "name": args.name, "offset": args.offset, "snippet": args.snippet, }, opts); } exports.getServiceList = getServiceList; /** * Retrieves a listing of config items. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scm from "@pulumi/scm"; * * // Data source to fetch all services in the "Shared" folder. * const allSharedServices = scm.getServiceList({ * folder: "All", * }); * export const allSharedServicesMap = allSharedServices.then(allSharedServices => .reduce((__obj, svc) => ({ ...__obj, [svc.name]: svc }))); * // Example of using pagination to get the first 5 services. * const paginatedServices = scm.getServiceList({ * folder: "All", * limit: 5, * offset: 0, * }); * export const paginatedServicesList = paginatedServices.then(paginatedServices => paginatedServices.datas); * export const paginatedServicesDetails = { * totalInFolder: paginatedServices.then(paginatedServices => paginatedServices.total), * limitUsed: paginatedServices.then(paginatedServices => paginatedServices.limit), * offsetUsed: paginatedServices.then(paginatedServices => paginatedServices.offset), * }; * ``` */ function getServiceListOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("scm:index/getServiceList:getServiceList", { "device": args.device, "folder": args.folder, "limit": args.limit, "name": args.name, "offset": args.offset, "snippet": args.snippet, }, opts); } exports.getServiceListOutput = getServiceListOutput; //# sourceMappingURL=getServiceList.js.map