Class: CDK8sPlus25::K8S::KubeNamespace
- Inherits:
-
CDK8s::APIObject
- Object
- Jsii::Object
- Constructs::Construct
- CDK8s::APIObject
- CDK8sPlus25::K8S::KubeNamespace
- Defined in:
- k8_s/kube_namespace.rb
Overview
Namespace provides a scope for Names.
Use of multiple namespaces is optional.
Class Method Summary collapse
-
::GVK ⇒ CDK8s::GroupVersionKind
Returns the apiVersion and kind for "io.k8s.api.core.v1.Namespace".
- .jsii_overridable_methods ⇒ Object
-
.manifest(props = nil) ⇒ Object
Renders a Kubernetes manifest for "io.k8s.api.core.v1.Namespace".
Instance Method Summary collapse
-
#add_dependency(*dependencies) ⇒ void
Create a dependency between this ApiObject and other constructs.
-
#add_json_patch(*ops) ⇒ void
Applies a set of RFC-6902 JSON-Patch operations to the manifest synthesized for this API object.
-
#api_group ⇒ String
The group portion of the API version (e.g.
authorization.k8s.io). -
#api_version ⇒ String
The object's API version (e.g.
authorization.k8s.io/v1). -
#chart ⇒ CDK8s::Chart
The chart in which this object is defined.
-
#initialize(scope, id, props = nil, &jsii_block) ⇒ KubeNamespace
constructor
Defines a "io.k8s.api.core.v1.Namespace" API object.
-
#kind ⇒ String
The object kind.
-
#metadata ⇒ CDK8s::APIObjectMetadataDefinition
Metadata associated with this API object.
-
#name ⇒ String
The name of the API object.
-
#node ⇒ Constructs::Node
The tree node.
-
#to_json ⇒ Object
Renders the object to Kubernetes JSON.
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Methods inherited from CDK8s::APIObject
Methods inherited from Constructs::Construct
Constructor Details
#initialize(scope, id, props = nil, &jsii_block) ⇒ KubeNamespace
Defines a "io.k8s.api.core.v1.Namespace" API object.
15 16 17 18 19 20 21 |
# File 'k8_s/kube_namespace.rb', line 15 def initialize(scope, id, props = nil, &jsii_block) props = props.is_a?(Hash) ? ::CDK8sPlus25::K8S::KubeNamespaceProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(scope, "eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9", "scope") Jsii::Type.check_type(id, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "id") Jsii::Type.check_type(props, "eyJmcW4iOiJjZGs4cy1wbHVzLTI1Lms4cy5LdWJlTmFtZXNwYWNlUHJvcHMifQ==", "props") unless props.nil? Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props, &jsii_block) end |
Class Method Details
::GVK ⇒ CDK8s::GroupVersionKind
Returns the apiVersion and kind for "io.k8s.api.core.v1.Namespace".
109 110 111 |
# File 'k8_s/kube_namespace.rb', line 109 def self.GVK() Jsii::Kernel.instance.get_static("cdk8s-plus-25.k8s.KubeNamespace", "GVK") end |
.jsii_overridable_methods ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'k8_s/kube_namespace.rb', line 23 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :api_group => { kind: :property, name: "apiGroup", is_optional: false }, :api_version => { kind: :property, name: "apiVersion", is_optional: false }, :chart => { kind: :property, name: "chart", is_optional: false }, :kind => { kind: :property, name: "kind", is_optional: false }, :metadata => { kind: :property, name: "metadata", is_optional: false }, :name => { kind: :property, name: "name", is_optional: false }, :to_string => { kind: :method, name: "toString", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :add_dependency => { kind: :method, name: "addDependency", is_optional: false }, :add_json_patch => { kind: :method, name: "addJsonPatch", is_optional: false }, :to_json => { kind: :method, name: "toJson", is_optional: false }, } end |
.manifest(props = nil) ⇒ Object
Renders a Kubernetes manifest for "io.k8s.api.core.v1.Namespace".
This can be used to inline resource manifests inside other objects (e.g. as templates).
46 47 48 49 50 |
# File 'k8_s/kube_namespace.rb', line 46 def self.manifest(props = nil) props = props.is_a?(Hash) ? ::CDK8sPlus25::K8S::KubeNamespaceProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, "eyJmcW4iOiJjZGs4cy1wbHVzLTI1Lms4cy5LdWJlTmFtZXNwYWNlUHJvcHMifQ==", "props") unless props.nil? Jsii::Kernel.instance.call_static("cdk8s-plus-25.k8s.KubeNamespace", "manifest", [props]) end |
Instance Method Details
#add_dependency(*dependencies) ⇒ void
This method returns an undefined value.
Create a dependency between this ApiObject and other constructs.
These can be other ApiObjects, Charts, or custom.
142 143 144 145 146 147 |
# File 'k8_s/kube_namespace.rb', line 142 def add_dependency(*dependencies) dependencies.each_with_index do |item, index| Jsii::Type.check_type(item, "eyJmcW4iOiJjb25zdHJ1Y3RzLklDb25zdHJ1Y3QifQ==", "dependencies[#{index}]") end jsii_call_method("addDependency", [*dependencies]) end |
#add_json_patch(*ops) ⇒ void
This method returns an undefined value.
Applies a set of RFC-6902 JSON-Patch operations to the manifest synthesized for this API object.
155 156 157 158 159 160 |
# File 'k8_s/kube_namespace.rb', line 155 def add_json_patch(*ops) ops.each_with_index do |item, index| Jsii::Type.check_type(item, "eyJmcW4iOiJjZGs4cy5Kc29uUGF0Y2gifQ==", "ops[#{index}]") end jsii_call_method("addJsonPatch", [*ops]) end |
#api_group ⇒ String
The group portion of the API version (e.g. authorization.k8s.io).
62 63 64 |
# File 'k8_s/kube_namespace.rb', line 62 def api_group() jsii_get_property("apiGroup") end |
#api_version ⇒ String
The object's API version (e.g. authorization.k8s.io/v1).
69 70 71 |
# File 'k8_s/kube_namespace.rb', line 69 def api_version() jsii_get_property("apiVersion") end |
#chart ⇒ CDK8s::Chart
The chart in which this object is defined.
76 77 78 |
# File 'k8_s/kube_namespace.rb', line 76 def chart() jsii_get_property("chart") end |
#kind ⇒ String
The object kind.
83 84 85 |
# File 'k8_s/kube_namespace.rb', line 83 def kind() jsii_get_property("kind") end |
#metadata ⇒ CDK8s::APIObjectMetadataDefinition
Metadata associated with this API object.
90 91 92 |
# File 'k8_s/kube_namespace.rb', line 90 def () jsii_get_property("metadata") end |
#name ⇒ String
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 calling
Chart.of(this).generatedObjectName(this), which by default uses the
construct path to generate a DNS-compatible name for the resource.
102 103 104 |
# File 'k8_s/kube_namespace.rb', line 102 def name() jsii_get_property("name") end |
#node ⇒ Constructs::Node
The tree node.
55 56 57 |
# File 'k8_s/kube_namespace.rb', line 55 def node() jsii_get_property("node") end |
#to_json ⇒ Object
Renders the object to Kubernetes JSON.
165 166 167 |
# File 'k8_s/kube_namespace.rb', line 165 def to_json() jsii_call_method("toJson", []) end |
#to_string ⇒ String
Returns a string representation of this construct.
116 117 118 |
# File 'k8_s/kube_namespace.rb', line 116 def to_string() jsii_call_method("toString", []) end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
129 130 131 132 133 134 |
# File 'k8_s/kube_namespace.rb', line 129 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, "eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9", "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |