@pulumi/kubernetes
Version:
[](https://github.com/pulumi/pulumi-kubernetes/actions) [](https://slack.pulumi.com) [;
exports.ResourceClaim = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../../utilities");
/**
* ResourceClaim describes a request for access to resources in the cluster, for use by workloads. For example, if a workload needs an accelerator device with specific properties, this is how that request is expressed. The status stanza tracks whether this claim has been satisfied and what specific resources have been allocated.
*
* This is an alpha type and requires enabling the DynamicResourceAllocation feature gate.
*/
class ResourceClaim extends pulumi.CustomResource {
/**
* Get an existing ResourceClaim 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 opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, opts) {
return new ResourceClaim(name, undefined, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ResourceClaim. 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'] === ResourceClaim.__pulumiType;
}
/**
* Create a ResourceClaim resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name, args, opts) {
let resourceInputs = {};
opts = opts || {};
if (!opts.id) {
if (args?.spec === undefined && !opts.urn) {
throw new Error("Missing required property 'spec'");
}
resourceInputs["apiVersion"] = "resource.k8s.io/v1alpha3";
resourceInputs["kind"] = "ResourceClaim";
resourceInputs["metadata"] = args?.metadata;
resourceInputs["spec"] = args?.spec;
resourceInputs["status"] = undefined /*out*/;
}
else {
resourceInputs["apiVersion"] = undefined /*out*/;
resourceInputs["kind"] = undefined /*out*/;
resourceInputs["metadata"] = undefined /*out*/;
resourceInputs["spec"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "kubernetes:resource.k8s.io/v1alpha1:ResourceClaim" }, { type: "kubernetes:resource.k8s.io/v1alpha2:ResourceClaim" }, { type: "kubernetes:resource.k8s.io/v1beta1:ResourceClaim" }, { type: "kubernetes:resource.k8s.io/v1beta2:ResourceClaim" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(ResourceClaim.__pulumiType, name, resourceInputs, opts);
}
}
exports.ResourceClaim = ResourceClaim;
/** @internal */
ResourceClaim.__pulumiType = 'kubernetes:resource.k8s.io/v1alpha3:ResourceClaim';
//# sourceMappingURL=resourceClaim.js.map