@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
113 lines • 3.87 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.AggregateV2 = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a Host Aggregate within Openstack Nova.
*
* ## Example Usage
*
* ### Full example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const dellServers = new openstack.compute.AggregateV2("dell_servers", {
* region: "RegionOne",
* name: "dell_servers",
* zone: "nova",
* metadata: {
* cpus: "56",
* },
* hosts: [
* "myhost01.example.com",
* "myhost02.example.com",
* ],
* });
* ```
*
* ### Minimum required example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const test = new openstack.compute.AggregateV2("test", {name: "test"});
* ```
*
* ## Import
*
* You can import an existing Host Aggregate by their ID.
*
* ```sh
* $ pulumi import openstack:compute/aggregateV2:AggregateV2 myaggregate 24
* ```
*
* The ID can be obtained with an openstack command:
*
* $ openstack aggregate list
*
* +----+------+-------------------+
*
* | ID | Name | Availability Zone |
*
* +----+------+-------------------+
*
* | 59 | test | None |
*
* +----+------+-------------------+
*/
class AggregateV2 extends pulumi.CustomResource {
/**
* Get an existing AggregateV2 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 AggregateV2(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AggregateV2. 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'] === AggregateV2.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["hosts"] = state ? state.hosts : undefined;
resourceInputs["metadata"] = state ? state.metadata : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["zone"] = state ? state.zone : undefined;
}
else {
const args = argsOrState;
resourceInputs["hosts"] = args ? args.hosts : undefined;
resourceInputs["metadata"] = args ? args.metadata : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["zone"] = args ? args.zone : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AggregateV2.__pulumiType, name, resourceInputs, opts);
}
}
exports.AggregateV2 = AggregateV2;
/** @internal */
AggregateV2.__pulumiType = 'openstack:compute/aggregateV2:AggregateV2';
//# sourceMappingURL=aggregateV2.js.map