Package org.cdk8s
Class ApiObject
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- software.constructs.Construct
-
- org.cdk8s.ApiObject
-
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.68.0 (build b45f2f6)", date="2022-09-25T00:11:18.333Z") @Stability(Stable) public class ApiObject extends software.constructs.Construct
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ApiObject.Builder
A fluent builder forApiObject
.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ApiObject(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
protected
ApiObject(software.amazon.jsii.JsiiObjectRef objRef)
ApiObject(software.constructs.Construct scope, String id, ApiObjectProps props)
Defines an API object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDependency(@NotNull software.constructs.IConstruct... dependencies)
Create a dependency between this ApiObject and other constructs.void
addJsonPatch(@NotNull JsonPatch... ops)
Applies a set of RFC-6902 JSON-Patch operations to the manifest synthesized for this API object.String
getApiGroup()
The group portion of the API version (e.g.String
getApiVersion()
The object's API version (e.g.Chart
getChart()
The chart in which this object is defined.String
getKind()
The object kind.ApiObjectMetadataDefinition
getMetadata()
Metadata associated with this API object.String
getName()
The name of the API object.static ApiObject
of(software.constructs.IConstruct c)
Returns the `ApiObject` named `Resource` which is a child of the given construct.Object
toJson()
Renders the object to Kubernetes JSON.-
Methods inherited from class software.constructs.Construct
onPrepare, onSynthesize, onValidate, toString
-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
-
-
-
Constructor Detail
-
ApiObject
protected ApiObject(software.amazon.jsii.JsiiObjectRef objRef)
-
ApiObject
protected ApiObject(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
ApiObject
@Stability(Stable) public ApiObject(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ApiObjectProps props)
Defines an API object.- Parameters:
scope
- the construct scope. This parameter is required.id
- namespace. This parameter is required.props
- options. This parameter is required.
-
-
Method Detail
-
of
@Stability(Stable) @NotNull public static ApiObject of(@NotNull software.constructs.IConstruct c)
Returns the `ApiObject` named `Resource` which is a child of the given construct.If
c
is anApiObject
, it is returned directly. Throws an exception if the construct does not have a child namedDefault
or if this child is not anApiObject
.- Parameters:
c
- The higher-level construct. This parameter is required.
-
addDependency
@Stability(Stable) public void addDependency(@NotNull @NotNull software.constructs.IConstruct... dependencies)
Create a dependency between this ApiObject and other constructs.These can be other ApiObjects, Charts, or custom.
- Parameters:
dependencies
- the dependencies to add. This parameter is required.
-
addJsonPatch
@Stability(Stable) public void addJsonPatch(@NotNull @NotNull JsonPatch... ops)
Applies a set of RFC-6902 JSON-Patch operations to the manifest synthesized for this API object.Example:
kubePod.addJsonPatch(JsonPatch.replace('/spec/enableServiceLinks', true));
- Parameters:
ops
- The JSON-Patch operations to apply. This parameter is required.
-
toJson
@Stability(Stable) @NotNull public Object toJson()
Renders the object to Kubernetes JSON.To disable sorting of dictionary keys in output object set the
CDK8S_DISABLE_SORT
environment variable to any non-empty value.
-
getApiGroup
@Stability(Stable) @NotNull public String getApiGroup()
The group portion of the API version (e.g. `authorization.k8s.io`).
-
getApiVersion
@Stability(Stable) @NotNull public String getApiVersion()
The object's API version (e.g. `authorization.k8s.io/v1`).
-
getChart
@Stability(Stable) @NotNull public Chart getChart()
The chart in which this object is defined.
-
getKind
@Stability(Stable) @NotNull public String getKind()
The object kind.
-
getMetadata
@Stability(Stable) @NotNull public ApiObjectMetadataDefinition getMetadata()
Metadata associated with this API object.
-
getName
@Stability(Stable) @NotNull public String getName()
The name of the API object.If a name is specified in
metadata.name
this will be the name returned. Otherwise, a name will be generated by callingChart.of(this).generatedObjectName(this)
, which by default uses the construct path to generate a DNS-compatible name for the resource.
-
-