UNPKG

@pulumi/azuredevops

Version:

A Pulumi package for creating and managing Azure DevOps.

124 lines 5.17 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.FeedRetentionPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages the Feed Retention Policy within Azure DevOps. * * ## Example Usage * * ### Project Feed * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.Project("example", { * name: "Example Project", * visibility: "private", * versionControl: "Git", * workItemTemplate: "Agile", * description: "Managed by Pulumi", * }); * const exampleFeed = new azuredevops.Feed("example", { * name: "ExampleFeed", * projectId: example.id, * }); * const exampleFeedRetentionPolicy = new azuredevops.FeedRetentionPolicy("example", { * projectId: example.id, * feedId: exampleFeed.id, * countLimit: 20, * daysToKeepRecentlyDownloadedPackages: 30, * }); * ``` * * ### Organization Feed * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.Feed("example", {name: "examplefeed"}); * const exampleFeedRetentionPolicy = new azuredevops.FeedRetentionPolicy("example", { * feedId: example.id, * countLimit: 20, * daysToKeepRecentlyDownloadedPackages: 30, * }); * ``` * * ## Relevant Links * * - [Azure DevOps Service REST API 7.0 - Feed Management](https://learn.microsoft.com/en-us/rest/api/azure/devops/artifacts/feed-management?view=azure-devops-rest-7.0) * * ## Import * * Azure DevOps Feed Retention Policy can be imported using the Project ID and Feed ID or Feed ID e.g.: * * ```sh * $ pulumi import azuredevops:index/feedRetentionPolicy:FeedRetentionPolicy example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000 * ``` * * or * * ```sh * $ pulumi import azuredevops:index/feedRetentionPolicy:FeedRetentionPolicy example 00000000-0000-0000-0000-000000000000 * ``` */ class FeedRetentionPolicy extends pulumi.CustomResource { /** * Get an existing FeedRetentionPolicy resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new FeedRetentionPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of FeedRetentionPolicy. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === FeedRetentionPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["countLimit"] = state ? state.countLimit : undefined; resourceInputs["daysToKeepRecentlyDownloadedPackages"] = state ? state.daysToKeepRecentlyDownloadedPackages : undefined; resourceInputs["feedId"] = state ? state.feedId : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; } else { const args = argsOrState; if ((!args || args.countLimit === undefined) && !opts.urn) { throw new Error("Missing required property 'countLimit'"); } if ((!args || args.daysToKeepRecentlyDownloadedPackages === undefined) && !opts.urn) { throw new Error("Missing required property 'daysToKeepRecentlyDownloadedPackages'"); } if ((!args || args.feedId === undefined) && !opts.urn) { throw new Error("Missing required property 'feedId'"); } resourceInputs["countLimit"] = args ? args.countLimit : undefined; resourceInputs["daysToKeepRecentlyDownloadedPackages"] = args ? args.daysToKeepRecentlyDownloadedPackages : undefined; resourceInputs["feedId"] = args ? args.feedId : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FeedRetentionPolicy.__pulumiType, name, resourceInputs, opts); } } exports.FeedRetentionPolicy = FeedRetentionPolicy; /** @internal */ FeedRetentionPolicy.__pulumiType = 'azuredevops:index/feedRetentionPolicy:FeedRetentionPolicy'; //# sourceMappingURL=feedRetentionPolicy.js.map