Skip to content

Commit

Permalink
Add apiextensions.CustomResource#get
Browse files Browse the repository at this point in the history
Fixes #323.
  • Loading branch information
hausdorff committed Dec 20, 2018
1 parent 7f7bf25 commit 7cd1ce3
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 4 deletions.
60 changes: 58 additions & 2 deletions pkg/gen/nodejs-templates/provider.ts.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,54 @@ export namespace apiextensions {
* fields required across all CRDs.
*/
export interface CustomResourceArgs {
apiVersion: pulumi.Input<string>,
kind: pulumi.Input<string>
/**
* APIVersion defines the versioned schema of this representation of an object. Servers should
* convert recognized schemas to the latest internal value, and may reject unrecognized
* values. More info:
* https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
*/
apiVersion: pulumi.Input<string>;
/**
* Kind is a string value representing the REST resource this object represents. Servers may
* infer this from the endpoint the client submits requests to. Cannot be updated. In
* CamelCase. More info:
* https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
*/
kind: pulumi.Input<string>;
/**
* Standard object metadata; More info:
* https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
*/
metadata?: pulumi.Input<inputApi.meta.v1.ObjectMeta>;
[othersFields: string]: pulumi.Input<any>;
}

/**
* CustomResourceGetOptions uniquely identifies a Kubernetes CustomResource, primarily for use
* in supplied to `apiextensions.CustomResource#get`.
*/
export interface CustomResourceGetOptions {
/**
* apiVersion is the API version of the apiExtensions.CustomResource we wish to select,
* as specified by the CustomResourceDefinition that defines it on the API server.
*/
apiVersion: pulumi.Input<string>;
/**
* kind is the kind of the apiextensions.CustomResource we wish to select, as specified by
* the CustomResourceDefinition that defines it on the API server.
*/
kind: pulumi.Input<string>
/**
* An ID for the Kubernetes resource to retrive. Takes the form <namespace>/<name> or
* <name>.
*/
id: pulumi.Input<pulumi.ID>;
}

/**
* CustomResource represents an instance of a CustomResourceDefinition (CRD). For example, the
* CoreOS Prometheus operator exposes a CRD `monitoring.coreos.com/ServiceMonitor`; to
Expand Down Expand Up @@ -325,6 +367,20 @@ export namespace apiextensions {
*/
public readonly metadata: pulumi.Output<outputApi.meta.v1.ObjectMeta>;
/**
* Get the state of an existing `CustomResource`, as identified by `id`.
* Typically this ID is of the form <namespace>/<name>; if <namespace> is omitted, then (per
* Kubernetes convention) the ID becomes default/<name>.
*
* Pulumi will keep track of this resource using `name` as the Pulumi ID.
*
* @param name _Unique_ name used to register this resource with Pulumi.
* @param opts Uniquely specifies a CustomResource to select.
*/
public static get(name: string, opts: CustomResourceGetOptions): CustomResource {
return new CustomResource(name, {apiVersion: opts.apiVersion, kind: opts.kind}, { id: opts.id });
}

public getInputs(): CustomResourceArgs { return this.__inputs; }
private readonly __inputs: CustomResourceArgs;

Expand Down
60 changes: 58 additions & 2 deletions sdk/nodejs/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3306,12 +3306,54 @@ export namespace apiextensions {
* fields required across all CRDs.
*/
export interface CustomResourceArgs {
apiVersion: pulumi.Input<string>,
kind: pulumi.Input<string>
/**
* APIVersion defines the versioned schema of this representation of an object. Servers should
* convert recognized schemas to the latest internal value, and may reject unrecognized
* values. More info:
* https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
*/
apiVersion: pulumi.Input<string>;

/**
* Kind is a string value representing the REST resource this object represents. Servers may
* infer this from the endpoint the client submits requests to. Cannot be updated. In
* CamelCase. More info:
* https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
*/
kind: pulumi.Input<string>;

/**
* Standard object metadata; More info:
* https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
*/
metadata?: pulumi.Input<inputApi.meta.v1.ObjectMeta>;
[othersFields: string]: pulumi.Input<any>;
}

/**
* CustomResourceGetOptions uniquely identifies a Kubernetes CustomResource, primarily for use
* in supplied to `apiextensions.CustomResource#get`.
*/
export interface CustomResourceGetOptions {
/**
* apiVersion is the API version of the apiExtensions.CustomResource we wish to select,
* as specified by the CustomResourceDefinition that defines it on the API server.
*/
apiVersion: pulumi.Input<string>;

/**
* kind is the kind of the apiextensions.CustomResource we wish to select, as specified by
* the CustomResourceDefinition that defines it on the API server.
*/
kind: pulumi.Input<string>

/**
* An ID for the Kubernetes resource to retrive. Takes the form <namespace>/<name> or
* <name>.
*/
id: pulumi.Input<pulumi.ID>;
}

/**
* CustomResource represents an instance of a CustomResourceDefinition (CRD). For example, the
* CoreOS Prometheus operator exposes a CRD `monitoring.coreos.com/ServiceMonitor`; to
Expand Down Expand Up @@ -3341,6 +3383,20 @@ export namespace apiextensions {
*/
public readonly metadata: pulumi.Output<outputApi.meta.v1.ObjectMeta>;

/**
* Get the state of an existing `CustomResource`, as identified by `id`.
* Typically this ID is of the form <namespace>/<name>; if <namespace> is omitted, then (per
* Kubernetes convention) the ID becomes default/<name>.
*
* Pulumi will keep track of this resource using `name` as the Pulumi ID.
*
* @param name _Unique_ name used to register this resource with Pulumi.
* @param opts Uniquely specifies a CustomResource to select.
*/
public static get(name: string, opts: CustomResourceGetOptions): CustomResource {
return new CustomResource(name, {apiVersion: opts.apiVersion, kind: opts.kind}, { id: opts.id });
}

public getInputs(): CustomResourceArgs { return this.__inputs; }
private readonly __inputs: CustomResourceArgs;

Expand Down

0 comments on commit 7cd1ce3

Please sign in to comment.