Class: CDK8sPlus25::K8S::JobTemplateSpec

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
k8_s/job_template_spec.rb

Overview

JobTemplateSpec describes the data a Job should have when created from a template.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata: nil, spec: nil) ⇒ JobTemplateSpec

Returns a new instance of JobTemplateSpec.

Parameters:



9
10
11
12
13
14
# File 'k8_s/job_template_spec.rb', line 9

def initialize(metadata: nil, spec: nil)
  @metadata = .is_a?(Hash) ? ::CDK8sPlus25::K8S::ObjectMeta.new(**.transform_keys(&:to_sym)) : 
  Jsii::Type.check_type(@metadata, "eyJmcW4iOiJjZGs4cy1wbHVzLTI1Lms4cy5PYmplY3RNZXRhIn0=", "metadata") unless @metadata.nil?
  @spec = spec.is_a?(Hash) ? ::CDK8sPlus25::K8S::JobSpec.new(**spec.transform_keys(&:to_sym)) : spec
  Jsii::Type.check_type(@spec, "eyJmcW4iOiJjZGs4cy1wbHVzLTI1Lms4cy5Kb2JTcGVjIn0=", "spec") unless @spec.nil?
end

Instance Attribute Details

#metadataCDK8sPlus25::K8S::ObjectMeta? (readonly)

Standard object's metadata of the jobs created from this template.

More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata



21
22
23
# File 'k8_s/job_template_spec.rb', line 21

def 
  @metadata
end

#specCDK8sPlus25::K8S::JobSpec? (readonly)

Returns:



27
28
29
# File 'k8_s/job_template_spec.rb', line 27

def spec
  @spec
end

Class Method Details

.jsii_propertiesObject



29
30
31
32
33
34
# File 'k8_s/job_template_spec.rb', line 29

def self.jsii_properties
  {
    :metadata => "metadata",
    :spec => "spec",
  }
end

Instance Method Details

#to_jsiiObject



36
37
38
39
40
41
42
43
# File 'k8_s/job_template_spec.rb', line 36

def to_jsii
  result = {}
  result.merge!({
    "metadata" => @metadata,
    "spec" => @spec,
  })
  result.compact
end