@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
124 lines • 4.66 kB
JavaScript
;
// *** 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.Dashboard = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages Dashboard within Azure DevOps project.
*
* > **NOTE:** Project level Dashboard allows to be created with the same name. Dashboard held by a team must have a different name.
*
* ## Example Usage
*
* ### Manage Project dashboard
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {
* name: "Example Project",
* description: "Managed by Pulumi",
* });
* const exampleDashboard = new azuredevops.Dashboard("example", {
* projectId: example.id,
* name: "Example dashboard",
* });
* ```
*
* ### Manage Team dashboard
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {
* name: "Example Project",
* description: "Managed by Pulumi",
* });
* const exampleTeam = new azuredevops.Team("example", {
* projectId: example.id,
* name: "Example team",
* });
* const exampleDashboard = new azuredevops.Dashboard("example", {
* projectId: example.id,
* name: "Example dashboard",
* teamId: exampleTeam.id,
* });
* ```
*
* ## Relevant Links
*
* - [Azure DevOps dashboards REST API 7.1 - Dashboard ](https://learn.microsoft.com/en-us/rest/api/azure/devops/dashboard/dashboards?view=azure-devops-rest-7.1)
*
* ## Import
*
* Azure DevOps Dashboard can be imported using the `projectId/dasboardId` or `projectId/teamId/dasboardId`
*
* ```sh
* $ pulumi import azuredevops:index/dashboard:Dashboard dashboard 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
* ```
*
* or
*
* ```sh
* $ pulumi import azuredevops:index/dashboard:Dashboard dashboard 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
* ```
*/
class Dashboard extends pulumi.CustomResource {
/**
* Get an existing Dashboard 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 Dashboard(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Dashboard. 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'] === Dashboard.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state?.description;
resourceInputs["name"] = state?.name;
resourceInputs["ownerId"] = state?.ownerId;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["refreshInterval"] = state?.refreshInterval;
resourceInputs["teamId"] = state?.teamId;
}
else {
const args = argsOrState;
if (args?.projectId === undefined && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
resourceInputs["description"] = args?.description;
resourceInputs["name"] = args?.name;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["refreshInterval"] = args?.refreshInterval;
resourceInputs["teamId"] = args?.teamId;
resourceInputs["ownerId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Dashboard.__pulumiType, name, resourceInputs, opts);
}
}
exports.Dashboard = Dashboard;
/** @internal */
Dashboard.__pulumiType = 'azuredevops:index/dashboard:Dashboard';
//# sourceMappingURL=dashboard.js.map