Class: CDK8sPlus25::K8S::CustomResourceDefinitionNames

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

Overview

CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind:, plural:, categories: nil, list_kind: nil, short_names: nil, singular: nil) ⇒ CustomResourceDefinitionNames

Returns a new instance of CustomResourceDefinitionNames.

Parameters:

  • kind (String)

    kind is the serialized kind of the resource.

  • plural (String)

    plural is the plural name of the resource to serve.

  • categories (Array<String>, nil) (defaults to: nil)

    categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). This is published in API discovery documents, and used by clients to support invocations like kubectl get all.

  • list_kind (String, nil) (defaults to: nil)

    listKind is the serialized kind of the list for this resource.

  • short_names (Array<String>, nil) (defaults to: nil)

    shortNames are short names for the resource, exposed in API discovery documents, and used by clients to support invocations like kubectl get <shortname>.

  • singular (String, nil) (defaults to: nil)

    singular is the singular name of the resource.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'k8_s/custom_resource_definition_names.rb', line 13

def initialize(kind:, plural:, categories: nil, list_kind: nil, short_names: nil, singular: nil)
  @kind = kind
  Jsii::Type.check_type(@kind, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "kind")
  @plural = plural
  Jsii::Type.check_type(@plural, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "plural")
  @categories = categories
  Jsii::Type.check_type(@categories, "eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=", "categories") unless @categories.nil?
  @list_kind = list_kind
  Jsii::Type.check_type(@list_kind, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "listKind") unless @list_kind.nil?
  @short_names = short_names
  Jsii::Type.check_type(@short_names, "eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=", "shortNames") unless @short_names.nil?
  @singular = singular
  Jsii::Type.check_type(@singular, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "singular") unless @singular.nil?
end

Instance Attribute Details

#categoriesArray<String>? (readonly)

categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). This is published in API discovery documents, and used by clients to support invocations like kubectl get all.

Returns:

  • (Array<String>, nil)


43
44
45
# File 'k8_s/custom_resource_definition_names.rb', line 43

def categories
  @categories
end

#kindString (readonly)

kind is the serialized kind of the resource.

It is normally CamelCase and singular. Custom resource instances will use this value as the kind attribute in API calls.

Returns:

  • (String)


33
34
35
# File 'k8_s/custom_resource_definition_names.rb', line 33

def kind
  @kind
end

#list_kindString? (readonly)

Note:

Default: kind`List".

listKind is the serialized kind of the list for this resource.

Defaults to "kindList".

Returns:

  • (String, nil)


50
51
52
# File 'k8_s/custom_resource_definition_names.rb', line 50

def list_kind
  @list_kind
end

#pluralString (readonly)

plural is the plural name of the resource to serve.

The custom resources are served under /apis/<group>/<version>/.../<plural>. Must match the name of the CustomResourceDefinition (in the form <names.plural>.<group>). Must be all lowercase.

Returns:

  • (String)


39
40
41
# File 'k8_s/custom_resource_definition_names.rb', line 39

def plural
  @plural
end

#short_namesArray<String>? (readonly)

shortNames are short names for the resource, exposed in API discovery documents, and used by clients to support invocations like kubectl get <shortname>.

It must be all lowercase.

Returns:

  • (Array<String>, nil)


56
57
58
# File 'k8_s/custom_resource_definition_names.rb', line 56

def short_names
  @short_names
end

#singularString? (readonly)

Note:

Default: lowercased kind.

singular is the singular name of the resource.

It must be all lowercase. Defaults to lowercased kind.

Returns:

  • (String, nil)


63
64
65
# File 'k8_s/custom_resource_definition_names.rb', line 63

def singular
  @singular
end

Class Method Details

.jsii_propertiesObject



65
66
67
68
69
70
71
72
73
74
# File 'k8_s/custom_resource_definition_names.rb', line 65

def self.jsii_properties
  {
    :kind => "kind",
    :plural => "plural",
    :categories => "categories",
    :list_kind => "listKind",
    :short_names => "shortNames",
    :singular => "singular",
  }
end

Instance Method Details

#to_jsiiObject



76
77
78
79
80
81
82
83
84
85
86
87
# File 'k8_s/custom_resource_definition_names.rb', line 76

def to_jsii
  result = {}
  result.merge!({
    "kind" => @kind,
    "plural" => @plural,
    "categories" => @categories,
    "listKind" => @list_kind,
    "shortNames" => @short_names,
    "singular" => @singular,
  })
  result.compact
end